preg_replace problem.

From: Date: Sun, 17 Feb 2002 09:09:50 +0000
Subject: preg_replace problem.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-85096@lists.php.net to get a copy of this message
where am i going wrong i used $mail = preg_replace("/<p[^>]*?>/i","\n\n$0", $mail,-1); and $mail = preg_replace("/<p[^>]*?>/i","\n\n\\1", $mail,-1); but i get $0 or \1 inserted, but only on the linux server not on my win 2000 dev machine! Paul Roberts roberts_paul@bigfoot.com ++++++++++++++++++++++++ ----- Original Message ----- From: "Anas Mughal" <anasmughal@yahoo.com> To: "Michael Sims" <mhsims@midsouth.rr.com>; <php-general@lists.php.net> Sent: Sunday, February 17, 2002 8:12 AM Subject: Re: [PHP] Could this be a configuration directive? > Thank you very much... > > This worked: > > $message = ${$this->func_name($string)}; > > > and, this worked: (I am going to stick with this) > > $message = ${$this->func_name}($string); > > > However, this did NOT work: > > $message = ${$this}->func_name($string); > > > Lesson learned: I need to enclose the function name > variable in curly braces. > > Thanks. > > > > --- Michael Sims <mhsims@midsouth.rr.com> wrote: > > At 11:22 PM 2/16/2002 -0800, Anas Mughal wrote: > > >I get a parse error using my CGI version of PHP on > > the > > >following line: > > > > > > $message = $$this->func_name($string); > > > > > >However, the same above line works fine with my > > ISP's > > >CGI version of PHP. > > > > That is strange. Just for kicks, try using curly > > braces to make the > > statement less ambiguous. Is the variable part just > > the object name, or is > > it the entire method? See if it works like this: > > > > $message = ${$this}->func_name($string); > > > > or like this: > > > > $message = ${$this->func_name($string)}; > > > > Depending on which one you mean. > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > ===== > Anas Mughal > anasmughal@yahoo.com > anasmughal@hotmail.com > Tel: 973-249-6665 > > __________________________________________________ > Do You Yahoo!? > Yahoo! Sports - Coverage of the 2002 Olympic Games > http://sports.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.general (#85096) next »