PHP 5.2 or PECL json 1.2 has the ability to convert data structures into JSON: $data = array(‘zero’, ‘one’, ‘two’, ‘three’); $json = json_encode($data); echo $json However, if you are deploying to a lowered PHP version, either because your hosting provider hasn’t caught up or you’re using Red Hat Enterprise (even the latest 5.3 only […]