I find it very difficult to remember the syntax of splice.
It might help to realize that splice and substr use the same syntax.
Arg0: Source (array or string) from which to extract items (elements or chars).
Arg1: Index of the item from which to start extracting. Negative indexes are relative to the end of the source.
Arg2: (Optional) Number of items to extract.
Arg3: (Optional) Items with which to replace the extracted items.
The difference is that splice is destructive (extracted elements are removed from the source) whereas substr is not (unless the Arg3 is specified).
In reply to Re^2: merging arrays
by ikegami
in thread merging arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |