[thelist] PHP question... checking string length

RUST Randal RRust at COVANSYS.com
Fri Mar 25 11:39:56 CST 2005

> Guys, got a quick question. In PHP, I usually test if a 
> string is empty like so:

> if ($myString=='') // do something

Try the empty() function.

if(empty($myString)){ //do something }

As to which way is better, I don't know. But I thought I would throw the
empty() function out there.

Randal Rust
Covansys Corporation
Columbus, OH
Confidentiality Statement:

This message is intended only for the individual or entity to which it is addressed. It may contain privileged, confidential information which is exempt from disclosure under applicable laws. If you are not the intended recipient, please note that you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information. If you have received this communication in error, please notify us immediately by return email.

More information about the thelist mailing list