Re: repetition of tedious references

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

 



rob, yes i thought of this, you could possible even do

function magic($array, $name, $default=null ) {
  return isset($array[$name]) && $array[$name] ? $array[$name] : $default;
}

$string = magic($_SERVER, "HTTP_ACCEPT_LANGUAGE", "*")

however i wish php would have some built-in support to solve the issue.

On 18/07/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:

function getServerVar( $name, $default=null )
{
    return isset( $_SERVER[$name] ) ? $_SERVER[$name] : $default;
}

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