Jump to content

[SOLVED] eregi_replace not working ,convert to preg_replace


DeanWhitehouse

Recommended Posts

<?php 
$oldstring = "[url=bob.php]bob[/url]";

$oldstring = eregi_replace("\[url=([^\[]+)\]([^\[]+)\][/url\]","<a href=\"\\1\" target=\"_blank\">\\2</a>", $oldstring);
echo $oldstring;
?>

 

this code is not doing anything, i don't know why it doesnt work, when i echo it it just says bob, anyone any ideas or can someone convert to preg_replace if need be?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.