Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 319 Bytes

null_if.md

File metadata and controls

17 lines (14 loc) · 319 Bytes

null_if()

Returns NULL if the given values are equal.

null_if($value, $compared = '')

  • $value - A given value.
  • $compared - Comparison value.
$var = '';
...
$var = null_if($var);  // $var = NULL

# Specify the comparision value
$var = array();
...
$var = null_if($var, []);  // $var = NULL