Skip to content
Extraits de code Groupes Projets
Valider 4dc4a2c0 rédigé par cerdic's avatar cerdic
Parcourir les fichiers

Report de r20709 : on peut appeller inc_simplexml_to_array en lui fournissant...

Report de r20709 : on peut appeller inc_simplexml_to_array en lui fournissant directement l'objet SimpleXML au lieu de la chaine (usage externe par des plugins en appel direct - Eric)
parent 174e9774
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -17,12 +17,14 @@ if (!defined('_ECRIRE_INC_VERSION')) return; ...@@ -17,12 +17,14 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
/** /**
* Transforme un texte XML en tableau PHP * Transforme un texte XML en tableau PHP
* @param string $u * @param string|object $u
* @param bool $utiliser_namespace * @param bool $utiliser_namespace
* @return array * @return array
*/ */
function inc_simplexml_to_array_dist($u, $utiliser_namespace=false){ function inc_simplexml_to_array_dist($u, $utiliser_namespace=false){
$u = simplexml_load_string($u); // decoder la chaine en SimpleXML si pas deja fait
if (is_string($u))
$u = simplexml_load_string($u);
return array('root'=>@xmlObjToArr($u, $utiliser_namespace)); return array('root'=>@xmlObjToArr($u, $utiliser_namespace));
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter