darkfreaks Posted February 18, 2008 Share Posted February 18, 2008 ok i made a hyperlink function to hyperlink links on my script using ereg_replace. how would i inlude something like www.mysite.com/inde.php?action= ??? <?php $text = ereg_replace('[a-zA-Z]+://(([.]?[a-zA-Z0-9_/-])*)', '<a href="\\1">\\1</a>',$text);?> Quote Link to comment Share on other sites More sharing options...
redarrow Posted February 18, 2008 Share Posted February 18, 2008 <?php $text="http://www.mysite.com/inde.php?action="; $text = preg_replace("/([a-zA-Z]+:\/\/[a-z0-9\_\.\-]+". "[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%\=\,\.]+)/", " <a href=\"$1\" target=\"_blank\">$1</a>", $text); echo $text; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.