PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Ali YILMAZ   PHP Is JSON Format   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Is JSON Format
Check if a string contains valid JSON encoded data
Author: By
Last change:
Date: 3 years ago
Size: 935 bytes
 

Contents

Class file image Download

What is is_json ?

It is used to check whether the string data shared with it is in json format, $schema represents the json data. If the data in question has a json syntax, true is returned, otherwise false is returned.

Out-of-class use:

data:

$schema = json_encode(array(
    'test'=>'ali'
));

code:

require_once('Mind.php');
$m = new Mind();
if($m::aliyilmaz('is_json')->is_json($schema)){
    echo 'This is a json data.';
} else {
    echo 'This is not a json.';
}

When using it in the class:

code:

if(self::aliyilmaz('is_json')->is_json($schema)){
    echo 'This is a json data.';
} else {
    echo 'This is not a json.';
}

output:

This is a json data.

Dependencies

This package has no dependencies.

License

Instructions and files in this directory are shared under the GPL3 license.