Posted By

kurokikaze on 03/13/09


Tagged

element array


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

vali29
BrianCoyDesign


Insert element in the middle of array


 / Published in: PHP
 

Instead of one element you can insert multiple at once: array($element1, $element2, $element3)

  1. array_splice($array, floor(count($array)/2), 0, $element);

Report this snippet  

You need to login to post a comment.