fork download
  1. <?php
  2. $str = '{"online": ["false"],"category": ["woman"],"subcategory": ["hats"],"id_product": ["KD45"],"color": ["Pink"]}';
  3. $arr = json_decode($str, 1);
  4. echo $arr['category'][0] . PHP_EOL; // woman
  5. echo $arr['id_product'][0]; // KD45
  6.  
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
woman
KD45