Re: Array Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux