Developer Support »

PHP coding question  (See more user questions)

Hi

These variables are "set":

$name = "";

$name = "Bob";

The first variable is "set" but is "empty". The second is also "set" but is
NOT empty.

Hence checking for:

if(isset($name) && !empty($name)){}

...in such a case I am only interested in the set variable that has a value
in it. "!empty" means "not empty". The exclamation mark makes the opposite
true. This is used in the script to check if a submitted form field is
empty or not.

If you really want to have fun, checkout the (authoritative) PHP manual
online:

http://php.net

You can search their function list for isset() and empty()

Have fun!

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

----- Original Message -----
Sent: Tuesday, March 02, 2010 7:29 AM
Subject: Re: FormToEmail-Pro script


Hi Charles,

<novicequestion>

When your code says (translated into English) something like: "If a certain
field has been filled in (isset), and it's not empty (empty())...." that
seems to me (as a COMPLETE beginner) to be the same thing duplicated. Am I
not understanding a subtle difference between the two?

</novicequestion>

Cheers




On 1 Mar 2010, at 23:47, FormToEmail.com wrote:

> My pleasure
>
> My biggest customer base is in the US, so I price in US Dollars (almost
> universal now on the internet) and I use some "American-isms", although I
> try to avoid them if possible!
>
> Cheers.
>
> Charles Sweeney
> https://formtoemail.com
> The world's easiest feedback script!
>
> ----- Original Message -----
> Sent: Monday, March 01, 2010 11:33 PM
> Subject: Re: FormToEmail-Pro script
>
>
>> On 1 Mar 2010, at 23:27, FormToEmail.com wrote:
>>
>>> Charles Sweeney (in the UK too, and yep, about bedtime!)
>>
>>
>> Doh! I was presuming you were in the U.S.
>>
>> Thanks for the help again.
>>
>> All the best