Created
July 10, 2012 15:31
-
-
Save rkmaier/3084090 to your computer and use it in GitHub Desktop.
PHP:: Get part of String based on start and end pattern
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
<?php | |
function getStringpart($string,$startStr,$endStr) | |
{ | |
$startpos=strpos($string,$startStr); | |
$endpos=strpos($string,$endStr,$startpos); | |
$endpos=$endpos-$startpos; | |
$string=substr($string,$startpos,$endpos); | |
return $string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment