mcaskill/php-is-blank

Determine whether a variable has a non-empty value.

Maintainers

Package info

gist.github.com/mcaskill/45c02c7366ca7ccc94ec91ad286c6de7

pkg:composer/mcaskill/php-is-blank

Statistics

Installs: 241

Dependents: 0

Suggesters: 0

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

This package is not auto-updated.

Last update: 2026-03-06 04:29:41 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.