- function_exists: documentation ( source)
- json_encode: documentation ( source)
<?php
if( !function_exists('json_encode') ){
die('json_encode not available yet');
}
$data = array('aps' => array(
'alert' => array(
'param1'=>array('string'),
'param2'=>'string' )));
echo json_encode($data);