<?php $output = json_encode(explode(',', trim('[x,y,z]', "[]"))); print_r($output);
Standard input is empty
["x","y","z"]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!