> I'm trying to pass a string variable to a custom function, echoing its
> *value on one line, and its *name (that is, its key if this were an array

I think you are looking for "variable variables"...

<?php
    $foo = 'test';
    $test = 42;
    echo "$foo is ", $$foo, "<BR>\n";
?>

Note the use of $$ to sort of "follow the trail" down to a variable.

Don't miss the Zend Web Store's Grand Opening on January 23, 2001!
http://www.zend.com
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to