Hello evryone
i need aregex code that replacing
url: http://domain.com at
link: <a href="http://domain.com" rel="nofollow">http://domain.com</a>
replace the url until space
Hello evryone
i need aregex code that replacing
url: http://domain.com at
link: <a href="http://domain.com" rel="nofollow">http://domain.com</a>
replace the url until space
$url = "http://www.diafol.org";
echo preg_replace("/(http:\/\/\S+)\s*/","<a href=\"$1\" rel=\"nofollow\">$1</a>",$url);
that'll work on the simplest of urls. check out url matches, e.g. ftp, https, with querystrings and username/pw and anchor hashes etc
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.