Reputation: 3312
I'm using PHP and MySql for my web application.
In Mysql I'm inserting string as JavaScript Array ["0","1","2","3","4","5","6"]
Now I'm retrieving value from database and save in PHP Variable $dow
I need to Convert this to PHP Array like $dow = array("0","1","2","3","4","5","6");
Upvotes: 3
Views: 815
Reputation: 115212
Use json_decode
in PHP for decoding JSON string.
$row = json_decode('["0","1","2","3","4","5","6"]');
Upvotes: 2