FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » help to debug a simple php preg_replace
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: help to debug a simple php preg_replace [message #172057 is a reply to message #172056] Fri, 28 January 2011 17:43 Go to previous messageGo to previous message
juliani(dot)moon(at)gmail(dot)co is currently offline  juliani(dot)moon(at)gmail(dot)co
Messages: 6
Registered: January 2011
Karma:
Junior Member
Ooops, the copy-paste was a mess. Now it is again:

<?php
if (file_exists("infile")) {
 $textline = file_get_contents("infile");
$hyprtext = preg_replace('/</', '&#60;', $textline);
$hyprtext = preg_replace('/>/', '&#62;', $textline);
 $hyprtext = preg_replace('/@/', '_at_', $textline);
 $hyprtext = preg_replace("/(http:\/\/[^\s]+)/", "<a href=\"$1\">$1</
a>", $textline);
 print "$hyprtext";}
?>

Note: The line for "http" works fine.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Shri Shraddha Astrology
Next Topic: Asynchronous FTP Upload
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Oct 19 17:24:36 GMT 2024

Total time taken to generate the page: 0.04120 seconds