E
E
Evgeniy Liferov2015-10-30 12:06:59
PHP
Evgeniy Liferov, 2015-10-30 12:06:59

How to increment array keys?

There is a first array with names: (First, Second, Third, Fourth).
second array with keys: ( 1,2,3,4)
Combine them (1->First,2->Second,3->Third,4->Fourth).
We increase the second array by 1. Provided that if the number is greater than 4, then we assign 1.
The first cycle - ( 2,3,4,1) is combined: (2->First,3->Second,4->Third,1 ->Fourth)
What ideas do you have? I can't write correctly, it always gives syntax errors.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Taratin, 2015-10-30
@Taraflex

https://secure.php.net/manual/en/function.array-co...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question