Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test union with keys after bracket notation --SKIPIF-- <?php if (!extension_loade..

Decoded Output download

--TEST--
Test union with keys after bracket notation
--SKIPIF--
<?php if (!extension_loaded("jsonpath")) print "skip"; ?>
--FILE--
<?php

$data = [
    [
        "c" => "cc1",
        "d" => "dd1",
        "e" => "ee1",
    ],
    [
        "c" => "cc2",
        "d" => "dd2",
        "e" => "ee2",
    ],
];

$jsonPath = new \JsonPath\JsonPath();
$result = $jsonPath->find($data, "$[0]['c','d']");

var_dump($result);
?>
--EXPECT--
array(2) {
  [0]=>
  string(3) "cc1"
  [1]=>
  string(3) "dd1"
}

Did this file decode correctly?

Original Code

--TEST--
Test union with keys after bracket notation
--SKIPIF--
<?php if (!extension_loaded("jsonpath")) print "skip"; ?>
--FILE--
<?php

$data = [
    [
        "c" => "cc1",
        "d" => "dd1",
        "e" => "ee1",
    ],
    [
        "c" => "cc2",
        "d" => "dd2",
        "e" => "ee2",
    ],
];

$jsonPath = new \JsonPath\JsonPath();
$result = $jsonPath->find($data, "$[0]['c','d']");

var_dump($result);
?>
--EXPECT--
array(2) {
  [0]=>
  string(3) "cc1"
  [1]=>
  string(3) "dd1"
}

Function Calls

None

Variables

None

Stats

MD5 65242b61a66f567868450b847932484c
Eval Count 0
Decode Time 115 ms