I need to need both the next script. How can I make them work together?
<?php echo ereg_replace("(http:\/\/[^ \n\t\f\r]*)", "<a href=\"\1\" target=\"_blank\">\1</a>", $hero->f("Ref")); ?>
<?php echo ereg_replace("\n", "<br>", $hero->f("Ref")); ?>
Hi Nico,
I don't quite seem to get your problem, but I'll give it a shot...
Use this:
<?php $html_text = $hero->f("Ref"); $html_text = nl2br(ereg_replace("(http:\/\/[^ \n\t\f\r]*)", "<a href=\"\1\" target=\"_blank\">\1</a>", $html_text); echo $html_text; ?>
Note that I replaced your second script with the common PHP function nl2br().
Greetz,
Vincent Driessen Webmaster PHP Freakz.com http://www.phpfreakz.com/ E-mail: vincent@phpfreakz.com