vikbert/istype

Type checks values in PHP

dev-main 2022-01-08 10:46 UTC

This package is auto-updated.

Last update: 2025-07-08 18:29:24 UTC


README

logo

Is::{method}($value)

Type checks values in PHP

PRs Welcome MIT License

Example

$isEmail = Is::email('vikbert@mail.com'); //=> true
$isEmail = Is::email('vikbert@mail'); //=> false

Install

composer req vikbert/istype

Test

vendor/bin/phpunit

API

usage return description
Is::email($value) bool check if it is an email string
Is::url($value) bool check if it is an URL string
Is::https($value) bool check if it is an URL with "https" scheme
Is::http($value) bool check if it is an URL with "http" scheme
Is::file($value) bool check if it is a valid file
Is::image($value) bool check if it is a valid image
Is::json($value) bool check if it is a valid json string
Is::xml($value) bool check if it is a valid xml string
Is::ip($value) bool check if it is a valid IP address

licence

MIT @vikbert