I would like to fix php array.
Dear my array as the following :
$stmyarr=Array ( [0] => [0]=>aaa,[1]=>ddd,[2]=>bbb,[3]=>ccc)
I want to remove [0] =>
So result when display is
Array ([0]=>aaa,[1]=>ddd,[2]=>bbb,[3]=>ccc)
How to do that ?
I would like to fix php array.
Dear my array as the following :
$stmyarr=Array ( [0] => [0]=>aaa,[1]=>ddd,[2]=>bbb,[3]=>ccc)
I want to remove [0] =>
So result when display is
Array ([0]=>aaa,[1]=>ddd,[2]=>bbb,[3]=>ccc)
How to do that ?
simple, just reassign the array name to [0]
// after your original $stmyarr
$stmyarr = array(0 => array( 0 => 'aaa', 1 => 'ddd', 2 => 'bbb', 3 => 'ccc'));
$stmyarr = $stmyarr[0];
print_r($stmyarr);
result is:
Array
(
[0] => aaa
[1] => ddd
[2] => bbb
[3] => ccc
)