Re: [PHP] Why does this preg_replace function not work?

2006-05-27 Thread Dave M G
Robin, Dan, Rabin, Thank you all for your advice. You've helped me understand regular expressions a little better, and cleared some some confusion about arrays. I'll be adapting all the code you provided for me needs. Thank you for taking the time to help. -- Dave M G -- PHP General

[PHP] Why does this preg_replace function not work?

2006-05-26 Thread Dave M G
PHP List, In the code below, I want to take the text within $content, and change every instance of [h3] into h3, and every instance of [/h3] into /h3. And then do the same for [em], [/em], [strong], and so on. However, this code does absolutely nothing to the text stored in content: $tags =

Re: [PHP] Why does this preg_replace function not work?

2006-05-26 Thread Rabin Vincent
On 5/26/06, Dave M G [EMAIL PROTECTED] wrote: PHP List, In the code below, I want to take the text within $content, and change every instance of [h3] into h3, and every instance of [/h3] into /h3. And then do the same for [em], [/em], [strong], and so on. However, this code does absolutely

RE: [PHP] Why does this preg_replace function not work?

2006-05-26 Thread Dan Parry
out :) HTH Dan -- Dan Parry Senior Developer Virtua Webtech Ltd http://www.virtuawebtech.co.uk -Original Message- From: Dave M G [mailto:[EMAIL PROTECTED] Sent: 26 May 2006 10:26 To: php-general@lists.php.net Subject: [PHP] Why does this preg_replace function not work? PHP List

Re: [PHP] Why does this preg_replace function not work?

2006-05-26 Thread Robin Vickery
On 26/05/06, Dave M G [EMAIL PROTECTED] wrote: I also tried str_replace(), but predictably that did not help. As far as I understand it, it does not accept arrays. It does, and you can do it with str_replace. What am I doing wrong in the above code? And can the two preg_replace() commands