Skip to content

Instantly share code, notes, and snippets.

@oluwaseye
Created July 29, 2019 18:37
Show Gist options
  • Save oluwaseye/2075029b96f3d578e91d991dfc25e094 to your computer and use it in GitHub Desktop.
Save oluwaseye/2075029b96f3d578e91d991dfc25e094 to your computer and use it in GitHub Desktop.
Extract string from markup
function tagExtractString($string, $start, $end) {
$string = " ".$string;
$init = strpos($string, $start);
if ($ini == 0) return "";
$init += strlen($start);
$len = strpos($string, $end, $init) - $init;
return substr($string, $init, $len);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment