RE: [PHP] \ Char Problems

From: Date: Wed, 13 Dec 2000 07:11:22 +0000
Subject: RE: [PHP] \ Char Problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-30052@lists.php.net to get a copy of this message
Sorry for the trouble :) Still not working... I have this array ('4' => 'a', '8' => 'b', 'c' => 'c', '3' => 'e', 'f' => 'f', '9' => 'g', '|-|' => 'h', '1' => 'i', 'j' => 'j', '|<' => 'k', '|' => 'l', '/\/\' => 'm', '|\|' => 'n', '0' => 'o', 'p' => 'p', 'q' => 'q', '|2' => 'r', '5' => 's', '7' => 't', 'u' => 'u', '\/' => 'v', '\/\/' => 'w','><' => 'x', ''/' => 'y', 'z' => 'z', '+' => 't') I get this error: Parse error: parse error, expecting `')'' in c:\inetpub\wwwroot\leetconv.php on line 12 -----Original Message----- From: jeremy brand [mailto:jeremy@nirvani.net] Sent: Wednesday, 13 December 2000 5:07 PM To: Matt Stone Cc: PHP List Subject: RE: [PHP] \ Char Problems double quotes use the back slash to escape characters, that is why you needed to use \\. use single quotes, then use single backslashes. -jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more Get your own Free, Private email at http://www.smackdown.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - At least for the people who send me mail about a new language that they're designing, the general advice is: do it to learn about how to write a compiler. --Dennis Ritchie On Wed, 13 Dec 2000, Matt Stone wrote: > Date: Wed, 13 Dec 2000 17:00:41 +1000 > From: Matt Stone <matt@planetveggie.com> > To: jeremy brand <jeremy@nirvani.net> > Cc: PHP List <php-general@lists.php.net> > Subject: RE: [PHP] \ Char Problems > > Like so? > '/\\/\\' => 'm' > it just returns "/\\/\\" > > -----Original Message----- > From: jeremy brand [mailto:jeremy@nirvani.net] > Sent: Wednesday, 13 December 2000 4:58 PM > To: Matt Stone > Cc: PHP List > Subject: Re: [PHP] \ Char Problems > > > Try using single quotes instead ('). > > -jeremy brand > > Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for > more > Get your own Free, Private email at http://www.smackdown.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > At least for the people who send me mail about a new language that > they're designing, the general advice is: do it to learn about > how to write a compiler. --Dennis Ritchie > > On Wed, 13 Dec 2000, Matt Stone wrote: > > > Date: Wed, 13 Dec 2000 16:55:32 +1000 > > From: Matt Stone <matt@planetveggie.com> > > To: PHP List <php-general@lists.php.net> > > Subject: [PHP] \ Char Problems > > > > Hi, > > I have a code that converts certain chars (l33t chars) into normal text. > > What I am trying to do is convert all instances of "/\/\" in a string to > > "M". > > I have some code that stores all the leet/normal text conversions like so: > > "M" => "/\/\", "N" => "|\|" > > The problems is that if I have it like this then I get a parse error > because > > of the \ chars. If I change the code like this: > > "M" => "/\\/\\", "N" => "|\\|" > > Then the conversion is not made because it will not find "/\\/\\" in the > > string, only "/\/\". Any ideas? Thanks, > > > > Matt Stone > > > > _______________________________ > > > > This email may contain confidential and/or privileged information for the > > sole use of the intended recipient. Any review or distribution by others > is > > strictly prohibited. If you have received this email in error, please > > contact the sender and delete all copies. Opinions, conclusions or other > > information expressed or contained in this email are not given or endorsed > > by the sender unless otherwise affirmed independently by the sender. > > > > _________________________________ > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#30052) next »