You are here: Re: [PHP] Array Help « PHP « IT news, forums, messages
Re: [PHP] Array Help

Posted by Robert Cummings on 03/15/05 03:34

On Mon, 2005-03-14 at 18:07, Phil Neeb wrote:
> Greets,
> I'm running into the problem of not having a server that gives me database
> access or ability to use files to store my data ... Yeah, I know, it sucks.
> Anyway ... My page has a number of profiles about people involved with my
> organization and all the profiles load into a set appearance. I have all
> the information about each person stored in individual arrays (if there's an
> easier way to do this w/o database or files, I'd love to hear it) ...
> anyway, I pass a variable through the URL which causes the array info to
> load, but I use an if statement for EVERYONE which makes my work way too
> tedious ... The variable I pass is the same value as the name each person's
> array (the variable is stored in the link) so, I'm curious if there's a way
> I can use the variable as the array name and cut out those tons of if
> statements.

if( isset( $$person ) )
{
$profile = $$person;
}

Where the value of $person is a string that corresponds to the profile
array name you wish to access.

Cheers,
Rob.
--
..------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

 

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

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