jsonDecode() публичный Метод

JSON decodes a variable. Twig has a built-in json_encode filter, but no built-in function to JSON decode a string. This functionality remedies that.
public jsonDecode ( string $string ) : array
$string string The string to decode.
Результат array The JSON decoded array
Пример #1
0
 public function testJsonDecode()
 {
     $app = $this->getApp();
     $handler = new TextHandler($app);
     $array = ['koala' => 'gum leaves', 'extension' => 'Clippy'];
     $result = $handler->jsonDecode(json_encode($array));
     $this->assertSame($array, $result);
 }