An open API service indexing awesome lists of open source software.

https://github.com/vikbert/istype

A simple PHP library for checking the type
https://github.com/vikbert/istype

Last synced: 9 months ago
JSON representation

A simple PHP library for checking the type

Awesome Lists containing this project

README

          


logo

Is::{method}($value)


Type checks values in PHP



PRs Welcome


MIT License


---

## Example

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

## Install

```bash
composer req vikbert/istype
```

## Test

```bash
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](https://vikbert.github.io/)