searchMandataires( $searchStr, array('V', 'N', 'H', 'A', 'M'), //types de mandataires $filtre); $tableResults = array(); $tableResults = $O['result']; }catch (SoapFault $fault){ echo 'Erreur durant la recherche'; exit; } $output = array(); $output[] = array( 'label' => "A l'adresse du bien vendu", 'id' => 'adresse' ); /* REGEX Code Postal : ^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$ (?0 ){ $i=0; foreach ($tableResults as $code=>$lib){ $tabResults[$i]['code'] = $code; $tabResults[$i]['lib'] = htmlspecialchars_decode( html_entity_decode($lib), ENT_QUOTES); preg_match('/(? $row){ $code[$key] = $row['code']; $lib[$key] = $row['lib']; $cp[$key] = $row['cp']; } //Classement du tableau array_multisort($cp, SORT_NUMERIC, $tabResults); $firephp->log($tabResults,'tabResults'); //Affichage des valeurs foreach ($tabResults as $item){ $output[] = array( 'label' => $item['lib'], 'id' => $item['code'] ); } } echo json_encode($output);