2017 © Pedro Peláez
 

library boolify

A PHP Library to make something a boolean.

image

philsown/boolify

A PHP Library to make something a boolean.

  • Friday, August 5, 2016
  • by philsown
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Boolify

A PHP Library to make something that's kinda true or false into a genuine boolean., (*1)

This will take a variety of values and return either true or false., (*2)

Usage

```lang=php <?php, (*3)

use Phdc\Boolify\Boolify;, (*4)

// $someValue has been set previously $bool = Boolify::cast($someValue);, (*5)

// $bool is now a boolean ```, (*6)

True Values

  • true
  • "True"
  • "true"
  • 1
  • "1"
  • "Yes"
  • "yes"
  • "Y"
  • "y"
  • An integer greater than 0
  • A non-empty array
  • A non-empty object

False Values

  • false
  • "False"
  • "false"
  • "F"
  • "f"
  • 0
  • "0"
  • "No"
  • "no"
  • "N"
  • "n"
  • Any integer less than 1
  • An empty array
  • An empty object
  • Null

The Versions

05/08 2016

dev-master

9999999-dev https://github.com/philsown/boolify

A PHP Library to make something a boolean.

  Sources   Download

MIT

php library boolean lolphp