JPOPHP
Original author(s) | Max Base |
---|---|
Developer(s) | Max Base |
Initial release | 2018 |
Stable release | 2.2.1
/ Apr 2019 |
Engine | |
Operating system | Cross-platform |
Type | PHP Library |
License | GNU General Public License v3.0 |
Website | PHP JsonParser at Github |
Search JPOPHP on Amazon.
JPOPHP (Json Parser Object PHP) is a library for parsing data in JSON format. JPOPHP is used primarily to encode and decode JSON data. This library is licensed under the GNU General Public License v3.0[1] and is open-source.[2][3][4][5][6]
PHP JSON Parser is published in the Official PHP Classes Repository. [7] JsonParserObjectPHP was a reason the Max a first rank in the US and ranked fourth in the world at the 2019/02.[8]
Type of supported values[edit]
- Integer
- Float
- Boolean (
true
,false
) - Null
- String
- Char
- Sub Array
- Sub Object
Functionalities[edit]
- Supports JSON Grammar.
- Support all data types.
- Encode and Decode the JSON data.
- Support Unicode.
Awards[edit]
- PHP Programming Innovation award nominee, January 2019. [7]
- PHP Programming Innovation award winner, February 2019. [9]
History[edit]
- In 2018, Max Base began designing this library.
- In 2019/01, This package is published in the Official PHP Classes Repository.[10]
- In 2019/01/25, This package has also been downloaded and used up to 9,384.[8]
- In 2019/02/27, Rank first in the US (This week).
- In 2019/02/27, Receive the Innovation Award By PHP Classes.
- In 2019/03/05, Rank first in the Canada (This week).[11]
- In 2019/03/25, Rank first in the Canada (This week).
- In 2019/03/31, This package has publish in the Composer.[2]
- In 2019/04/02. In the recent 2019 competition, this library was chosen as one of the best. (Third place) and now (2019/04/04) are rank 2nd classes in the world.
- In 2019/04/03, First rank in the User Ratings in month. (2019-04)
- In 2019/04/04, In the current week, Max Basewas introduced as the second most popular programmer. [12]
- In 2019/04/04, First rank in the Top user rated classes, 65% of all comments from forum users were assigned to this library. [12]
Functions[edit]
Function Name | Goal | Parameter(s) | Return |
---|---|---|---|
encode | Encode the data in JSON format. | $input (Array or Object) | String |
decode | Decode the data in JSON format. | $input (JSON string) | Array |
Initial[edit]
E.g.: We define the class in $json variable.
$json=new Json;
Encode[edit]
$array = array(null, false, true);
$result = $json->encode($array);
print( $result );
Decode[edit]
$string = '[null,false,true]';
$result = $json->decode($string);
print_r( $result );
Example[edit]
<?php
include "JPOPHP.php";
/* Version: 2.2+ */
print $json->encode([1,2,3,4])."\n";
print $json->encode([1,2,[94,15,34,67],3,4,["name"=>"max"]])."\n";
print $json->encode(["name"=>"max","age"=>49,"username"=>"BaseMax"])."\n";
print $json->encode(["0"=>"max","1"=>49,"2"=>"BaseMax"])."\n";
print $json->encode([0=>"max",1=>49,2=>"BaseMax"])."\n";
print $json->encode([0=>"max","1.5"=>49,2=>"BaseMax"])."\n";
print "\n\n";
print $json->decode('[]')."\n";
print $json->decode('{}')."\n";
print $json->decode('["1"]')."\n";
print $json->decode('["123456"]')."\n";
print $json->decode('["hi"]')."\n";
print $json->decode('["hi\""]')."\n";
print $json->decode('["hi\"!"]')."\n";
print $json->decode('[13]')."\n";
print $json->decode('[134]')."\n";
print $json->decode('[8]')."\n";
print $json->decode('[0]')."\n";
print $json->decode('[-9]')."\n";
print $json->decode('[-945]')."\n";
print $json->decode('[3.1]')."\n";
print $json->decode('[3.145]')."\n";
print_r($json->decode(' [ -3.145,4,"test"]'));
print_r($json->decode(' [ -3.145,4,"test","name":"max"]'));
print_r($json->decode(' [ -3.145,4,"name","max",]'));
print_r($json->decode(' [ -3.145,4,"name","max",,,,,,,]'));
print_r($json->decode(' [,]'));
print_r($json->decode(' [,,,,]'));
print_r($json->decode(' [,,,,4]'));
print_r($json->decode('{}'));
print_r($json->decode('{"a":4,"6":945,,,}'));
print_r($json->decode('{"a":4,"b":456,,,,}'));
print_r($json->decode('{,"a":4,}'));
print_r($json->decode('{,,,"a":4,"b":456,,,,}'));
print_r($json->decode('{,,,,"a":4,,,,,,"6":945,,,}'));
print_r($json->decode('[,,,,]'));
print_r($json->decode('[4]'));
print_r($json->decode(' [,,,,4]'));
print_r($json->decode(' [ , , , , 4]'));
print_r($json->decode(' [ , , , , 4 ] '));
print_r($json->decode(' [ , , , , 4 ] '));
print_r($json->decode("[\n]"));
print_r($json->decode('["max",49,"BaseMax"]'));
print_r($json->decode('[1,[]]'));
print_r($json->decode('[1,[4]]'));
print_r($json->decode('[1,[4,,,6,[8]]]'));
print_r($json->decode('{"name":"Max","line":456,,,,}'));
print_r($json->decode('{"name":"Max","line":456,,,,}'));
// print_r($json->decode('{"name":"Max",4:555,,,,}')); // Error!
print_r($json->decode('[null,false,true]'));
$res=($json->decode('[null,false,true]'));
var_dump($res[1]);
var_dump($res);
var_dump($json->decode('[null,false,true,]'));
print_r($json->decode("[\"45\\\\\"]"));
$arg='["4\\\\"]';
var_dump($arg);
print $arg."\n";
print_r($json->decode($arg));
print_r($json->decode('["1\u05B5"]'));
print_r($json->decode('["1\u05F1"]'));
print_r($json->decode('["1\u05F"]'));
print_r($json->decode('["1\u05FX"]'));
print_r($json->decode('["1\uM05F"]'));
print_r($json->decode('["1\uM0\'5F"]'));
/* Version: 0 - 2.0
$data=json_encode([1,2,3,4,5,"n\"am':=>[]{}e"=>"ali"]);
$data=json_encode(["name"=>"ali","int"=>110,"float"=>19.98,"-int"=>-110,"-float"=>-19.98,"bool"=>true]);
//$data=json_encode(["name"=>"ali","int"=>110,"float"=>19.98,"-int"=>-110,"-float"=>-19.98,"bool"=>true,"list"=>[1,2,3,4,5]]);
//$data=json_encode(["name"=>"ali","int"=>110,"float"=>19.98,"-int"=>-110,"-float"=>-19.98,"bool"=>true,"list"=>["name"=>"ali","family"=>"ahmadi"]]);
//print $data."\n";
//$array=$json->decode($data);
//$array=$json->decode('{"list":{"name":"ali","family":"ahmadi"}}');
$array=$json->decode('{"list":{"name":"ali","family":"ahmadi"},"age":18}');
//$array=$json->decode('{"name":"ali","int":110,"float":19.98,"-int":-110,"-float":-19.98,"bool":TRUE,"bbb":false}');
print_r($array);
//print_r($json->array);
*/
References[edit]
- ↑ "GNU General Public License v3.0".
- ↑ 2.0 2.1 "basemax/jsonparser - Packagist". packagist.org. Retrieved 2019-03-31.
- ↑ "Notable PHP package: PHP JSON Parser Class - PHP Classes". www.phpclasses.org. Retrieved 2019-06-10.
- ↑ "basemax/jpophp-jsonparser - Packagist". packagist.org. Retrieved 2019-06-11.
- ↑ "How do I extract data from JSON with PHP?". Stack Overflow. Retrieved 2019-06-12.
- ↑ "What is the JPOPHP?". Max. 2019-06-10. Retrieved 2019-06-12.
- ↑ 7.0 7.1 "PHP JSON Parser Class: Encode and decode data in JSON format - PHP Classes". www.phpclasses.org. Retrieved 2019-03-31.
- ↑ 8.0 8.1 "LMPHP: Support to multiple languages to PHP applications - PHP Classes". web.archive.org. 2019-01-25. Retrieved 2019-01-25.
- ↑ "Innovation Award winners - PHP Classes". www.phpclasses.org. Retrieved 2019-06-11.
- ↑ "PHP JSON Parser Class: Encode and decode data in JSON format - PHP Classes". www.phpclasses.org. Retrieved 2019-01-25.
- ↑ "Classes of Max Base - PHP Classes". phpclasses.org. 2019-03-05. Retrieved 2019-03-05.
- ↑ 12.0 12.1 "Top 10 charts - PHP Classes". web.archive.org. 2019-04-03. Retrieved 2019-04-04.
- ↑ 13.0 13.1 Base, Max (2019-03-31), Tiny Library for parse JSON. Contribute to BaseMax/JsonParser development by creating an account on GitHub, retrieved 2019-03-31
This article "JPOPHP" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:JPOPHP. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.