makeSearch(); switch($wanted){ case "results": $as->getResults(); $return = array( 'nb_results' => $as->getNbResults(), 'results' => $as->results ); break; default : $return = array( 'nb_results' => $as->getNbResults() ); break; } $return['affiliate_tabLabel'] = $msg['in_affiliate_source']; $return['any_results_msg'] = $msg['affiliate_source_any_results']; //On renvoie du JSON dans le charset de PMB... if(!$debugtest){ header("Content-Type:application/json; charset=$charset"); $return = charset_pmb_normalize($return); print json_encode($return); }else{ highlight_string(print_r($return,true)); } function charset_pmb_normalize($mixed){ global $charset; $is_array = is_array($mixed); $is_object = is_object($mixed); if($is_array || $is_object){ foreach($mixed as $key => $value){ if($is_array) $mixed[$key]=charset_pmb_normalize($value); else $mixed->$key=charset_pmb_normalize($value); } }elseif ($charset!="utf-8") { $mixed =utf8_encode($mixed); } return $mixed; } ?>