note 53844 deleted from function.trim by hholzgra

From: Date: Thu, 02 Aug 2012 12:22:49 +0000
Subject: note 53844 deleted from function.trim by hholzgra
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189639@lists.php.net to get a copy of this message
Note Submitter: ---- here's a heads up folks. in the event that you want to check the result of a trim for being empty the following code fails:: $emptyvar = " "; if ( empty(trim($emptyvar)) ) { echo "It was empty"; } this code works as expected:: $emptyvar = " "; $check = trim($emptyvar); if ( empty($check) ) { echo "It was empty"; }

« previous php.notes (#189639) next »