Jeysingh Anbu Jeysingh Anbu - 1 year ago 78
Javascript Question

PHP - How to Convert Javascript Array to PHP array

I'm using PHP and MySql for my web application.

In Mysql I'm inserting string as JavaScript Array


Now I'm retrieving value from database and save in PHP Variable

I need to Convert this to PHP Array like
$dow = array("0","1","2","3","4","5","6");

Answer Source

Use json_decode in PHP for decoding JSON string.

$row = json_decode('["0","1","2","3","4","5","6"]');