Created
March 23, 2012 10:54
-
-
Save vrushank-snippets/2169579 to your computer and use it in GitHub Desktop.
PHP : Get the text between $start and $end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetBetween($content,$start,$end){ | |
$r = explode($start, $content); | |
if (isset($r[1])){ | |
$r = explode($end, $r[1]); | |
return $r[0]; | |
} | |
return ''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment