Skip to content

Instantly share code, notes, and snippets.

@jonasermert
Created October 22, 2017 08:12
Show Gist options
  • Save jonasermert/11ba8ed1672af32cbc13a9913ac1f736 to your computer and use it in GitHub Desktop.
Save jonasermert/11ba8ed1672af32cbc13a9913ac1f736 to your computer and use it in GitHub Desktop.
String in String suchen PHP
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