In your if
clause in the function, you're referring to a variable strTemp
that doesn't exist. $strTemp
does exist, though.
But PHP already has an empty()
function available; why make your own?
if (empty($str))
/* String is empty */
else
/* Not empty */
From php.net:
Return Values
Returns FALSE if var has a non-empty
and non-zero value.
The following things are considered to
be empty:
* "" (an empty string)
* 0 (0 as an integer)
* "0" (0 as a string)
* NULL
* FALSE
* array() (an empty array)
* var $var; (a variable declared, but without a value in a class)
http://www.php.net/empty