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);?> Link to comment https://forums.phpfreaks.com/topic/91783-hyperlink-help/ 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; ?> Link to comment https://forums.phpfreaks.com/topic/91783-hyperlink-help/#findComment-470088 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.