0
J'ai deux matrices comme ci-dessous;Besoin d'aide sur les matrices de mélange
$array1 = array(
'cover.xhtml',
'title.xhtml',
'copyright.xhtml',
'dedication.xhtml',
'toc_brief.xhtml',
'toc.xhtml',
'ch02_1.xhtml',
'ch02_2.xhtml',
'ch02_3.xhtml',
'ch02_4.xhtml',
'ch02_5.xhtml',
'ch02_6.xhtml',
'ch02_7.xhtml',
'ch02_8.xhtml',
'ch02_9.xhtml',
'ch02_10.xhtml'
);
$array2 = array(
'',
'title.xhtml',
'copyright.xhtml',
'dedication.xhtml',
'ch02_2.xhtml',
'ch02_2#454.xhtml',
'ch02_4.xhtml',
'ch02_1.xhtml',
'ch02_11.xhtml',
'ch02_12.xhtml',
''
);
résultat
devrait être:
array(
'cover.xhtml',
'title.xhtml',
'copyright.xhtml',
'dedication.xhtml',
'toc_brief.xhtml',
'toc.xhtml',
'ch02_1.xhtml',
'ch02_2.xhtml',
'ch02_2#454.xhtml',
'ch02_3.xhtml',
'ch02_4.xhtml',
'ch02_5.xhtml',
'ch02_6.xhtml',
'ch02_7.xhtml',
'ch02_8.xhtml',
'ch02_9.xhtml',
'ch02_10.xhtml',
'ch02_11.xhtml',
'ch02_12.xhtml'
)
J'ai essayé avec: call_user_func_array('array_merge', array_map(null, $array1, $array2));
Cela n'a pas produit le résultat que je avais besoin decribed que. S'il vous plaît aider.
Merci de votre réponse. L'ordre compte vraiment. Donc toujours essayer d'obtenir une solution. – Arghya
@Arghya ce sera difficile, car il ne suit pas vraiment un chemin logique. Ce n'est pas l'ordre alphabétique, c'est juste commandé pour la partie 'ch'. – FirstOne
hmm Je comprends et je suis d'accord Je suis coincé dedans depuis 2 jours – Arghya