function my_json_encode($type, $p){
if(PHP_VERSION >= '5.4'){
$str = json_encode($p, JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
} else {
switch($type){
case 'text':
isset($p['text']['content']) && ($p['text']['content'] = urlencode($p['text']['content']));
break;
}
$str = urldecode(json_encode($p));
}
return $str;
}