1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-09-01 09:03:03 +02:00

Fix and merge branch 'isJson'

This commit is contained in:
Daniel St. Jules
2013-08-31 18:43:42 -04:00
6 changed files with 85 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ A PHP library with a variety of string manipulation functions with multibyte sup
* [isAlphanumeric](#isalphanumeric)
* [isBlank](#isblank)
* [isHexadecimal](#ishexadecimal)
* [isJson](#isjson)
* [isLowerCase](#islowercase)
* [isSerialized](#isserialized)
* [isUpperCase](#isuppercase)
@@ -352,6 +353,19 @@ S::create('A102F')->isHexadecimal();
S::isHexadecimal('A102F'); // true
```
#### isJson
$stringy->isJson()
S::isJson(string $str [, string $encoding ])
Returns true if the string is JSON, false otherwise.
```php
S::create('{"foo":"bar"}')->isJson();
S::isJson('{"foo":"bar"}'); // true
```
#### isLowerCase
$stringy->isLowerCase()