PHP Output Buffering in WordPress
When you need to display an html file as a returned string
When you need to display an html file as a returned string
Right below lies a function that returns the string between two other strings. That’s it.
1 2 3 4 5 6 7 8 9 10 11 12 |
function get_string_between($string, $start, $end){ $string = ' ' . $string; $ini = strpos($string, $start); if ($ini == 0) return ''; $ini += strlen($start); $len = strpos($string, $end, $ini) - $ini; return substr($string, $ini, $len); } // USAGE $fullstring = 'this is my [tag]dog[/tag]'; $parsed = get_string_between($fullstring, '[tag]', '[/tag]'); |
Source : http://stackoverflow.com/questions/5696412/get-substring-between-two-strings-php
This is the way to display all errors in PHP…
So what do you have to do when you want to disable update warnings for specific plugins…
Well here’s how to open a pdf file and serve it to the browser with PHP….