Replace with ereg_replace
Hi all, I m trying to replace
i tried a number of times but could not get it work bcoz i dont know regular expressions... plz any idea...
Simplest solution without the overhead of regexps (and you should be using the preg_*() functions if you do, as the ereg functions are deprecated), would be something like:
$old = 'products.php?id=1-0';
$new = str_replace('.php?id=', '-', $old) . '.html';
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Thats gr8... i didnt imagine it was so simple... thanx alot
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread