Jump to content

Simple variable check problem


nobrain

Recommended Posts

I have this code:

 

if (!$value) {

$ok=0;

break;

}

 

It is supposed to check if a variable is not empty and, if it is, then fail.  The problem is that sometimes the variable is 0 -- then it also fails.  I need it to fail if the variable is empty but not if it has a value of 0.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/199409-simple-variable-check-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.