Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP equivalent to C# string.IsNullOrEmpty method?

Tags:

string

c#

php

null

is there an official equivalent to the C# isNullOrEmpty method in PHP? I know there is empty and such, but is this the same?

Thanks :)

like image 820
EOB Avatar asked Apr 26 '12 09:04

EOB


1 Answers

I'm using strlen for checking if string is null or empty.

if (strlen($str) == 0){
    //your code here
}
like image 191
Chuck Norris Avatar answered Sep 18 '22 06:09

Chuck Norris