PHP code example of vajexal / js-object-parser
1. Go to this page and download the library: Download vajexal/js-object-parser library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vajexal / js-object-parser example snippets
declare(strict_types=1);
use Vajexal\JsObjectParser\JsObjectParser;
se('true'), // bool(true)
$jsObjectParser->parse('123'), // int(123)
$jsObjectParser->parse("'foo'"), // string(3) "foo"
$jsObjectParser->parse('[1, 2]'), // array(2) { [0] => int(1) [1] => int(2) }
$jsObjectParser->parse("{foo: 'bar'}") // array(1) { ["foo"] => string(3) "bar" }
);