We help IT Professionals succeed at work.

What does this PHP sentence mean/do?

bhession
bhession asked
on
Medium Priority
281 Views
Last Modified: 2012-05-11
Dont know very much about PHP this shoule be a straightforward one for anyone familiar with it. Below I am trying to figure out what this line does so I can replicate it in Java.

if (!$power) $power=0;

I think it is saying, If power is null then power is 0.

Can anyone confirm?
Comment
Watch Question

Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Most Valuable Expert 2011
Author of the Year 2014

Commented:
If $power is empty, NULL, FALSE or Zero, it will assign the integer value Zero.
Most Valuable Expert 2011
Author of the Year 2014
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Much gratitude, very helpful. Thanks guys
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.