Answers for "how to insert value in php array at a specific postion"

PHP
0

php insert in array

$original = array( 'a', 'b', 'c', 'd', 'e' );
$inserted = array( 'x' ); // not necessarily an array, see manual quote

array_splice( $original, 3, 0, $inserted ); // splice in at position 3
// $original is now a b c x d e
Posted by: Guest on June-04-2020
0

push element in array php

Install ming++
Posted by: Guest on November-28-2021

Code answers related to "how to insert value in php array at a specific postion"

Browse Popular Code Answers by Language