8.5.6 normalize
array Set::normalize ($list, $assoc = true, $sep = ',', $trim = true)
Normalise une chaîne ou une liste de tableau.
$a = array('Arbre', 'CompteurDeCache','Telechargement' => array(
'repertoire' => 'produits',
'champs' => array('image_1_id', 'image_2_id', 'image_3_id', 'image_4_id', 'image_5_id')
));
$b = array('Cachable' => array('actif' => false),
'Limite',
'Liaison',
'Validateur',
'Transactionnel');
$resultat = Set::normalize($a);
/* $resultat ressemble maintenant à :
Array
(
[Arbre] =>
[CompteurDeCache] =>
[Telechargement] => Array
(
[repertoire] => produits
[champs] => Array
(
[0] => image_1_id
[1] => image_2_id
[2] => image_3_id
[3] => image_4_id
[4] => image_5_id
)
)
)
*/
$resultat = Set::normalize($b);
/* $resultat ressemble maintenant à :
Array
(
[Cachable] => Array
(
[actif] =>
)
[Limite] =>
[Liaison] =>
[Validateur] =>
[Transactionnel] =>
)
*/
$resultat = Set::merge($a, $b); // Maintenant mixons les deux et normalisons
/* $resultat ressemble maintenant à :
Array
(
[0] => Arbre
[1] => CompteurDeCache
[Telechargement] => Array
(
[repertoire] => produits
[champs] => Array
(
[0] => image_1_id
[1] => image_2_id
[2] => image_3_id
[3] => image_4_id
[4] => image_5_id
)
)
[Cachable] => Array
(
[actif] =>
)
[2] => Limite
[3] => Liaison
[4] => Validateur
[5] => Transactionnel
)
*/
$resultat = Set::normalize(Set::merge($a, $b));
/* $resultat ressemble maintenant à :
Array
(
[Arbre] =>
[CompteurDeCache] =>
[Telechargement] => Array
(
[repertoire] => products
[champs] => Array
(
[0] => image_1_id
[1] => image_2_id
[2] => image_3_id
[3] => image_4_id
[4] => image_5_id
)
)
[Cachable] => Array
(
[actif] =>
)
[Limite] =>
[Liaison] =>
[Validateur] =>
[Transactionnel] =>
)
*/
$a = array('Arbre', 'CompteurDeCache','Telechargement' => array('repertoire' => 'produits','champs' => array('image_1_id', 'image_2_id', 'image_3_id', 'image_4_id', 'image_5_id')));$b = array('Cachable' => array('actif' => false),'Limite','Liaison','Validateur','Transactionnel');$resultat = Set::normalize($a);/* $resultat ressemble maintenant à :Array([Arbre] =>[CompteurDeCache] =>[Telechargement] => Array([repertoire] => produits[champs] => Array([0] => image_1_id[1] => image_2_id[2] => image_3_id[3] => image_4_id[4] => image_5_id)))*/$resultat = Set::normalize($b);/* $resultat ressemble maintenant à :Array([Cachable] => Array([actif] =>)[Limite] =>[Liaison] =>[Validateur] =>[Transactionnel] =>)*/$resultat = Set::merge($a, $b); // Maintenant mixons les deux et normalisons/* $resultat ressemble maintenant à :Array([0] => Arbre[1] => CompteurDeCache[Telechargement] => Array([repertoire] => produits[champs] => Array([0] => image_1_id[1] => image_2_id[2] => image_3_id[3] => image_4_id[4] => image_5_id))[Cachable] => Array([actif] =>)[2] => Limite[3] => Liaison[4] => Validateur[5] => Transactionnel)*/$resultat = Set::normalize(Set::merge($a, $b));/* $resultat ressemble maintenant à :Array([Arbre] =>[CompteurDeCache] =>[Telechargement] => Array([repertoire] => products[champs] => Array([0] => image_1_id[1] => image_2_id[2] => image_3_id[3] => image_4_id[4] => image_5_id))[Cachable] => Array([actif] =>)[Limite] =>[Liaison] =>[Validateur] =>[Transactionnel] =>)*/


























