mcaskill/php-is-blank

Determine whether a variable has a non-empty value.

v1.0.0 2018-09-10 01:27 UTC

This package is not auto-updated.

Last update: 2024-12-12 22:43:19 UTC


README

(PHP 5 >= 5.4) is_blank — Determine whether a variable has a non-empty value.

Description

boolean is_blank( mixed $var )

Alternative to empty() that accepts non-empty values:

  • 0 (0 as an integer)
  • 0.0 (0 as a float)
  • "0" (0 as a string)

Parameters

  • var — The value to be checked.

Return Values

Returns FALSE if var exists and has a non-empty value. Otherwise returns TRUE.

Installation

With Composer

$ composer require mcaskill/php-is-blank

Without Composer

Why are you not using composer? Download Function.Is-Blank.php from the gist and save the file into your project path somewhere.