preg_replace

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

preg_replace

Post by Steveo31 »

Code: Select all

$output = preg_replace('|\[div](.*)\[/div]|ise',"str_replace('<br />', '', "<div class='div_code'>".highlight_string(stripslashes('\\1'),true)."</div>")", $row['body']);
//    $output = preg_replace('|(\[man](.*)\/\[/man])|ise', "'<a href=''http://www.php.net/\\1''>\\1</a>'", $output);
    echo nl2br($output);
And the output:

http://www.theobviousreasons.com/index. ... asic+MySQL

Worked the other night np.. argh!!!
Post Reply