<?php $str = " apply here https://ph.dbsd.com/job/dfvdfg/5444 and www.google.com also http://somesite.net "; $url_regex = "/\b((https?:\/\/?|www\.)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/)))/"; preg_match_all($url_regex, $str, $matches); foreach($matches[0] as $match){ $anchor = "<a href='$match'>$match</a>"; $str = str_replace($match, $anchor, $str); } echo $str; var_dump($matches);
You have javascript disabled. You will not be able to edit any code.