I have some content stored in a variable and it looks like"

```
$content = "This is a test content and the content of the url is http://www.test.com. The is a second sentence.";

```

Now my code is

```
$pos = strpos($content, '.');
$firstsentence = substr($content, 0, $pos);

```

The above code doesn't work as the string already contains a url having dots.

How can I get the first sentence considering the fact that a string contains a hyperlink?