Re: Variable Variables and Super Global Arrays

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

 



> $varname = "\$_SERVER['REMOTE_ADDR']";
> $varvalue = $$varname;

That's wrong. Offhand you'll end up printing a string. I tried this:

<?php
    $a   = 365;
    $b   = 366;

    $var = $_GET['var'];

    echo $$var;
?>

And it was fine.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

-- 
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