You are here: Re: how to avoid eval() « PHP Programming Language « IT news, forums, messages
Re: how to avoid eval()

Posted by Rik on 01/25/07 18:23

On Thu, 25 Jan 2007 18:10:45 +0100, Michael Fesser <netizen@gmx.de> wrot=
e:

> .oO(Nick Wedd)
>
>> I have a string, $cookiestring, which typically looks like this:
>> "us=3D1!uk=3D2!de=3D13!fr=3D8!". I want to use this to get values in=
to an array
>> $r, so that $r['us']=3D1, $r['uk']=3D2, etc.
>
> Another one:
>
> parse_str(strtr($cookiestring, array('!' =3D> '&')), $r);
>

D'oh! Nice one.

I thought about parse_str(), but then decided it couldn't be used becaus=
e =

of the '!'... The simple solution of replacing them just wouldn't op int=
o =

my head :)

-- =

Rik Wasmus
* I'm testing several new newsreaders at the moment. Please excuse =

possible errors and weird content. *

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация