Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
$string="Mary had a little black lamb";
$findme="little";
$searchpos=strpos($string,$findme);
$searchspace=strpos($string," ",$searchpos);
$searchspace2=strpos($string," ",$searchspace+1);
$searchspace3=strrpos(substr($string,0,$searchpos-1)," ");
print substr($string,$searchspace3,$searchspace2-$searchspace3);
?>
if (preg_match("/ ([^ ]+little[^ ]+) /", $string, $matches))
$result = $matches[1];
if (preg_match("/[^ ]+ little [^ ]+/", $string, $matches))
$result = $matches[0];
<?php
$mary = "Mary had a little black lamb";
preg_match ('/\w+ little \w+/', $mary, $results);
print $results[0];
?>
if (preg_match("/(\w+ ){0,5}$term( \w+){0,5}/i", $string, $matches))
echo $matches[0];
(\w+ )
{0,5}