tags:

views:

52

answers:

3

array:

A-B-C-D-E-F

J is the son of C. update array so:

A-B-C-J-D-E-F

how do I insert J after C in the array?

I also map the array in a loop (array of comments for display). Will this method take a very long time to perform?

+2  A: 

You can use the splice function:

http://php.net/manual/en/function.array-splice.php

Tim
+2  A: 

You can use array_splice() with $length set to 0.

http://de.php.net/manual/en/function.array-splice.php

Pekka
thanks you, i'll use it.
sombe
+1  A: 

Use the splice function.

edit, damn you guys are all fast ;)

Ben Fransen