How to change the order of values within a PHP array?

Asked

Viewed 93 times

0

I have the following array:

$arraymaterias=array('his;51','mat;60','mat;60','mat;60','mat;60','mat;32','por;60','por;60','por;60','por;60','por;60','por;60','por;60','por;37');

I wanted her to interject, to stay every hour a subject, ex:

$arraymateriasnova=array('his;51','mat;60','por;60,'mat;60','por;60,'mat;60''por;60','mat;60','por;60','mat;32','por;60','por;60','por;60','por;37');
  • don’t I understand? could be clearer

  • Especially in the "stay every hour a subject"

  • this array is mounted with a foreach, each loop takes all the values of the matter, then it assembles all the values of the material1, after all of the material 2, and after all of the material 3, I need it to take the 1st value of the material 1, after the first value of the material 2 after the 1st value of the material 3, after the 2nd of the material 1(if it still has), 2º of the material 2 and so on

  • 2

    Time to ride that foreach do this relocation.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.