php-general Digest 1 Apr 2013 02:46:46 -0000 Issue 8179

Topics (messages 320719 through 320721):

Re: isset empty or ...?
        320719 by: Александр Меньщиков
        320720 by: Jim Giner

Re: 4/1/2013 3:46:37 AM
        320721 by: Adil Adil

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
http://www.php.net/manual/en/types.comparisons.php
Maybe first table PHP functions comparison (including 'isset' and 'empty') 
could help you.


31.03.2013 в 8:53, John Taylor-Johnston написал(а):
> I'm using

if($mydata->>DPRresponselocationaddress1 != "")

> is this the same as

if (!isset($mydata->>DPRresponselocationaddress))
> http://php.net/manual/en/function.isset.php

> or

if (!empty($mydata->>DPRresponselocationaddress))
> http://php.net/manual/en/function.empty.php

> or is there another function I have not learned yet? I don't really get 
> the difference between isset and empty.

> John



-- 
С уважением, Александр Меньщиков

Тел.: +7 921 408-6-777
E-mail: amenshchi...@gmail.com

Attachment: pgpI71SX1RqsG.pgp
Description: PGP signature


--- End Message ---
--- Begin Message ---
On 3/31/2013 12:53 AM, John Taylor-Johnston wrote:
I'm using

if($mydata->DPRresponselocationaddress1 != "")

is this the same as

if (!isset($mydata->DPRresponselocationaddress))
http://php.net/manual/en/function.isset.php

or

if (!empty($mydata->DPRresponselocationaddress))
http://php.net/manual/en/function.empty.php

or is there another function I have not learned yet? I don't really get
the difference between isset and empty.

John
The simple answer is that isset is supposed to tell you if a var has been created; a test for "" is looking for a value of a var. While sometimes the results can be the same (and therefore confusing) that is what the two provide. How you use them is dependent on your understanding of PHP and the task before you.
--- End Message ---
--- Begin Message ---
http://www.siamphotographer.com/clvrcng/nikoffbkvvnjjcgwapmay.xmhpwcbrd

--- End Message ---

Reply via email to