Logo

Programming-Idioms

History of Idiom 110 > diff from v16 to v17

Edit summary for version 17 by :
New PHP implementation by user [programming-idioms.org]

Version 16

2016-02-23, 14:32:27

Version 17

2016-02-23, 21:00:40

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Code
$blank = !trim($s);
Comments bubble
Php 5.4 or older.
Doc URL
http://php.net/manual/en/ref.strings.php