I have this string for example:
$str = 'The quick fox. <img src="image.jpg" /> Jumped over. The lazy Dog.';
I need to get the first two sentence (or first two dots). How can I skip <img src="image.jpg" />
from being exploded when using
$arr = explode('.', $str);
Here's my current code.
$len = 2;
$arr = explode('.', $str);
$arr2 = array_slice($arr, 0, $len);
$str = implode('.', $arr2).'.';