Re: Re: what's the difference in the following code?

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

 



I would understand it if it was like this ..

<?php
$search = isset($_GET['search']) ? $_GET['search'] : '';
# versus
if (isset($_GET['search'])) { $search = $_GET['search']; }
?>

In the first statement $search would either be set to $_GET['search']
or an empty string, whereas in the second statement $search would only
be set, if there is a $_GET['search']

//A yeti

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