So we all know that array_push
works like this:
<?php
$a=array("red","green");
array_push($a,"blue","yellow");
print_r($a);
?>
So the result would be:
Array ( [0] => red [1] => green [2] => blue [3] => yellow )
But now I need to know how can I append the blue and yellow after a certain value of the array.
So for example, if I determine that, push the blue and yellow after the red (which has the position of 0), this result would be shown:
Array ( [0] => red [1] => blue [2] => yellow [3] => green)
So how can I push element after a certain value of an array?