0

I get this kind of string from JS to PHP. [[1,"10.00","10.00","A"],[2,"20.00","25.00","B"],[3,"10.00","25.00","C"],[6,"10.00","25.00","D"]]

How can I convert it to a php multidimensional array?

Note: I tried json_encode without getting the desired result.

1 Answers1

0
<?php
$string = '[[1,"10.00","10.00","A"],[2,"20.00","25.00","B"],[3,"10.00","25.00","C"],[6,"10.00","25.00","D"]]';

$result = json_decode($string);
var_dump($result);
?>

You should use json_decode instead of json_encode for convert JSON to array PHP

Result: Ressult

sukalogika
  • 603
  • 4
  • 11
  • 18