How to match bare urls with regex in PHP? -



How to match bare urls with regex in PHP? -

$bits = preg_split('#((?:https?|ftp)://[^\s\'"<>()]+)#s', $token->data, -1, preg_split_delim_capture);

say,i'm trying match urls need linkified.the above permissive.

i want match simple urls http://google.com, not <a href="http://google.com">http://google.com</a>, or <iframe src="http://google.com"></iframe>

it appears you're trying parse html using regular expressions. you might want rethink that.

php regex url

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -