Skip to main content
specifications on the usage of empty()
Source Link
davidgmar
  • 548
  • 1
  • 3
  • 10

look towards isset and empty.

http://php.net/manual/fr/function.isset.php

http://php.net/manual/fr/function.empty.php

Edit : The comments below are true. Empty should be used for empty strings, not numeric values, float values or a zero in a string​​. However, here's a function if you need to accept these as valid values:

function is_blank($value) { return empty($value) && !is_numeric($value); } 

look towards isset and empty.

http://php.net/manual/fr/function.isset.php

http://php.net/manual/fr/function.empty.php

Edit : The comments below are true. Empty should be used for empty strings, not numeric values, float values or a zero in a string​​. However, here's a function if you need to accept these as valid values:

function is_blank($value) { return empty($value) && !is_numeric($value); } 
Source Link
davidgmar
  • 548
  • 1
  • 3
  • 10