note 126020 added to function.array-splice
| From: | Anonymous at main dot php dot net | Date: | Sat, 17 Apr 2021 10:03:38 +0000 |
| Subject: | note 126020 added to function.array-splice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216294@lists.php.net to get a copy of this message | ||
the following:
$input = [[5=>"richard=red"], [15=>"york=yellow"],
[25=>"gave=green"], [30=>"battle=blue"], [35=>"in=indigo"],
[40=>"vain=violet"]];
array_splice($input, 2, 0, [[10=>"of=orange"]]);
var_dump($input);
gives this:
array (size=7)
0 =>
array (size=1)
5 => string 'richard=red' (length=11)
1 =>
array (size=1)
15 => string 'york=yellow' (length=11)
2 =>
array (size=1)
10 => string 'of=orange' (length=9)
3 =>
array (size=1)
25 => string 'gave=green' (length=10)
4 =>
array (size=1)
30 => string 'battle=blue' (length=11)
5 =>
array (size=1)
35 => string 'in=indigo' (length=9)
6 =>
array (size=1)
40 => string 'vain=violet' (length=11)
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 2a02:c7f:dcf5:f400:f1d1:72d7:80ff:6d22)
----
Manual Page -- https://php.net/manual/en/function.array-splice.php
Edit -- https://main.php.net/note/edit/126020
Del: integrated -- https://main.php.net/note/delete/126020/integrated
Del: useless -- https://main.php.net/note/delete/126020/useless
Del: bad code -- https://main.php.net/note/delete/126020/bad+code
Del: spam -- https://main.php.net/note/delete/126020/spam
Del: non-english -- https://main.php.net/note/delete/126020/non-english
Del: in docs -- https://main.php.net/note/delete/126020/in+docs
Del: other reasons-- https://main.php.net/note/delete/126020
Reject -- https://main.php.net/note/reject/126020
Search -- https://main.php.net/manage/user-notes.php