Možda:
PHP kôd:
function has_links($input) {
$url = '([\w-]+:\/\/?|(www|([\w]+))[.])[^\s()<>\[\]]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/))'; // @webarto
$pattern = '/(' . $url . ')(?!(?:.(?!\[url(=' . $url . ')?\]))*\[\/url\])/i';
return preg_match_all($pattern, $input);
}
$text = '[url=www.site.com]site[/url] sdf sadf https://www.site2.rs/ asdf
asdf https://www.site3.com [url]www.devprotalk.com[/url] 6gfghgh http://www.site4.com 78tzuzu';
var_dump(has_links($text));
$text = 'sadasd [url=www.site.com]site[/url] sdf sadf [url]http://www.devprotalk.com[/url]';
var_dump(has_links($text));
$text = 'http://www.megacenter.dk/phpBB3/viewtopic.php?f=19&t=179269&p=206614#p206614
http://www.giagz.com/post/viewtopic.php?f=7&t=498104&p=651775#p651775
http://forum.cliptricks.com/viewtopic.php?f=11&t=643309&p=919764#p919764
You will never know how it feels until you truly own a pair of Christian Louboutin.. For the past 15 years, Robbins has been doing exactly that. After being on the pill for more than 10 years, my period was really short, brown, and low flow with spotting for several days before actually starting. Initially, I would welcome feedback on what I presented as the preliminary steps. Born shoes are constructed from a perfect leading material. You might not be able to get hold of the right provider with the best possible deal in the very first search without any issues.';
var_dump(has_links($text));