Created
July 29, 2019 18:37
-
-
Save oluwaseye/2075029b96f3d578e91d991dfc25e094 to your computer and use it in GitHub Desktop.
Extract string from markup
This file contains 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 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