Suppose I have a line like
$res = "there are many restaurants in the city. Restaurants like xyz,abc. one restaurant like.....";
In the above example we can find restaurant in 3 places. I need count to be 3.
$pattern = '/Restaurant/';
preg_match($pattern, substr($res,10), $matches, PREG_OFFSET_CAPTURE);
print_r($matches);
Another problem. This is due to the above issue. that is, I have text, for example Food & Drinks. I need to combine this word with foodor drinksor seafood... etc., Someone can help me in getting this. Thank you in advance.
user3011850
source
share