What does != "" mean in programming

regsamp
regsamp used Ask the Experts™
on
I am just getting into a little php and programming and I would like to know what something like
If ($sMap != "") what does !="" mean and what does "" and " " on its own generally mean?

Thank you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
dovidfCEO
Commented:
Returns true if $x is not equal to $y, or they are not of the same type

Author

Commented:
And the "" is the $y?
1. != means "not equal to", (a!=b value of a is not equal to b),
2.  == means both are equal(a==b value of a and b are equal),
3. && means AND (condition 1 "and" condition 2 both are true)
4.|| means OR (condition 1 "or" condition 2 either on is true )
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I understand that but what does !="" mean? It is "not equal to" double quotes, space, nothing?
In your condition If ($sMap != "")

"" means empty, so this condition checks if $sMap value is NOT empty.

Author

Commented:
That is what I thought. Thank you everyone. I am a newbie so I appreciate it.
Most Valuable Expert 2011
Top Expert 2016

Commented:
If you're new to PHP and want to learn the language, this article can help.  Just skip over the parts you already know from other programming languages, work experience, or academic learning.
https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html

Author

Commented:
Thank you very much for that link and the resources.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial