Skip to content

πŸ‘‰ "PHP type names" contains the list of constants for all PHP data types, to avoid hardcoding them πŸ‘Œ

License

Notifications You must be signed in to change notification settings

pH-7/PHP-type-names

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

33 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PHP type names ⚑️

Get all valid PHP type names with constants βœ…

πŸ“„ Overview

Simple library containing the list of constants for the available PHP data types. Use those constant types in your project when you need to mention a data type, use those constants instead of hardcoding them.

βš™οΈ Requirements

βš™οΈ Installation

Install it easily with Composer

composer require ph-7/datatype

🀠 Example

require_once __DIR__ . '/vendor/autoload.php';

use PH7\Datatype\Type;

$id = settype($_GET['id'], Type::STRING);

$name = settype($inputName, Type::STRING);

πŸ˜‹ Who cooked it?

Pierre-Henry Soria

Pierre-Henry Soria, a highly passionate, zen & pragmatic software engineer 😊

@phenrysay pH-7

πŸ“Ί The Video

Watch the video

πŸ‘‰ Watch on YouTube πŸ‘ˆ

βš–οΈ License

PHP type names is generously distributed under the MIT.