preg_match to identify if its a link, str_replace or preg_replace to make it a link. Google is your friend!![]()
No man, that's not what I want.I have list of text urls, its big list so I can't do <a href= for all individually.I want a script that will turn text links into live links automatically.
<?php
$urlList="http://www.blackhatworld.com
http://www.google.com
http://www.yahoo.com
http://www.some.other.site/";
$urlArray = split("\n", $urlList);
foreach($urlArray as $urlLine)
{
echo "<a href=\"" . trim($urlLine) . "\">" . trim($urlLine) . "</a>\n";
}
?>