PHP beginner |
|
<?php
$msg = "http://www.website.nl";
//Automatische URL herkenning
$ACCEPT_CHARS = "a-z0-9_~#&;=./?+-";
$msg = eregi_replace("(http|https|ftp|news)://([$ACCEPT_CHARS]+)", "<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>", $msg);
echo $msg;
?>
<?php $msg = "http://www.website.nl"; //Automatische URL herkenning $ACCEPT_CHARS = "a-z0-9_~#&;=./?+-"; $msg = eregi_replace("(http|https|ftp|news)://([$ACCEPT_CHARS]+)", "<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>", $msg); ?>
|