JOAOSANTACRUZ.COM

Parse string between two keywords

Get all the text from a string between start and end keyword


						

<? function parseMyString($string, $startTxt, $endTxt){ $start = strpos($string, $startTxt) + strlen($startTxt); $end = strlen($string) - ($start + strlen($endTxt)); $parse = substr($string, $start, $end); return($parse); } #Usage echo parseMyString($v["nome"], "(", ")"); ?>

Go Back