Re: EMPTY??

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

 



On 10/23/07, Dan Shirah <mrsquash2@xxxxxxxxx> wrote:
>
> I made two variables for the same posted value because I believe empty()
> does not work with strtoupper in front of the value. It only works with a
> standalone variable, correct?


no; strtoupper modifies its argument, that is all.
empty evaluates the argument it is given that is all.
therefore, if empty is passed an string with no contents that has been
passed through
strtoupper, it will still be regarded as empty.

<?php
    $var = strtoupper('');
     if(empty($var)) { echo 'var is empty'; }
?>

When comments is left blank and I echo out the value for $check_comments it
> returns nothing at all which is why I think empty() or "" should work, but
> they don't.


try using var_dump(); you will see that it is a string that has no contents,
or perhaps some
whitespace characters.

-nathan

[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