derek4716
asked on
easy if statement question
I know i can do the following to see if a variable doesn't have a value:
if($test eq ''){
But how do I have it look to see if it has a value(any value at all)
for example
if($test eq '*'){
is this possible thanks
if($test eq ''){
But how do I have it look to see if it has a value(any value at all)
for example
if($test eq '*'){
is this possible thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This checks if it has a non-zero value, which would be in the case of an integer equaling a zero or a string with no content. Similarly you can check to see if a variable has even been created by going like this:
if(exists$test){...}