Created
October 22, 2017 08:12
-
-
Save jonasermert/11ba8ed1672af32cbc13a9913ac1f736 to your computer and use it in GitHub Desktop.
String in String suchen PHP
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 outputStringPositionsFunctionNew2($longText, $searchTexts){ | |
foreach ($searchTexts as $searchText){ | |
$tmpArray = array(); | |
if(preg_match(‚/‘.$searchText.’/s‘,$longText,$tmpArray,PREG_OFFSET_CAPTURE)) | |
echo $tmpArray[0][1].“\n“; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment