You are here: Re: [PHP] Building key sequences from strings « PHP « IT news, forums, messages
Re: [PHP] Building key sequences from strings

Posted by Greg Donald on 09/29/78 11:05

On Tue, 11 Jan 2005 16:10:00 -0500 (EST), Bruce Cooper
<coop.ie@excite.com> wrote:
> I'm trying to set up a custom sort for multi-level [i.e. nested] arrays. The problem is I can't seem to get PHP to recognize syntax such as follows
>
> $test=$test_array.'[index][next]';
>
> The above example is greatly simplified. In the real world I'd be dynamically building that string to pin on the end.[i.e. I'd like to be able the drill down to a depth determined from inside a function rather than having to hard-code it] I'm all confused. The same type of syntax works for other variable types....
>
> What am I doing wrong ?


Use eval() on the string after you construct it.

php.net/eval


--
Greg Donald
Zend Certified Engineer
http://destiney.com/

 

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

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