次の配列があります。
$front = array("front_first","front_second");
$inside = array("inside_first", "inside_second", "inside_third");
$back = array("back_first", "back_second", "back_third","back_fourth");
私がする必要があるのは、上記の状況で出力が次のようになるように組み合わせることです。出力順序は常にそれらを順番に並べることback, front, inside
です:
$final = array(
"back_first",
"front_first",
"inside_first",
"back_second",
"front_second",
"inside_second",
"back_third",
"front_second",
"inside_third",
"back_fourth",
"front_second",
"inside_third"
);
したがって、基本的には 3 つの配列を調べ、値が少ない方の配列は、長い方の配列の残りのキーをループするまで、最後の値を複数回再利用します。
これを行う方法はありますか?私は困惑しています/