doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

array_unshift page, add an example with two associative arrays

Open tiffany-taylor opened this issue 3 years ago • 6 comments

Added an example that shows how two associative arrays are combined using array_unshift()

https://www.php.net/manual/en/function.array-unshift.php

tiffany-taylor avatar Nov 05 '22 20:11 tiffany-taylor

~~Gah, need to fix the spacing on <![CDATA[, didn't mean to alter that.~~ Fixed.

tiffany-taylor avatar Nov 05 '22 21:11 tiffany-taylor

Converting this to draft so that I can provide a better example.

tiffany-taylor avatar Nov 07 '22 01:11 tiffany-taylor

I suggest not to think of "multi-dimensional" arrays in PHP; that eases the understanding how these are handled by language constructs and functions.

That said, I'm not against adding such an example for array_unshift(), since almost everybody talks about "multi-dimensional" PHP arrays.

cmb69 avatar Nov 07 '22 17:11 cmb69

TFW I realize I meant to call it "associative" and not "multi-dimensional" 😆

tiffany-taylor avatar Nov 09 '22 16:11 tiffany-taylor

check-whitespace fails on a line that I fixed in the latest commit. It appears the job is looking at an older commit where the trailing whitespace was present. I'm not sure if the current failed job is a false-positive, or something I need to resolve.

tiffany-taylor avatar Nov 09 '22 18:11 tiffany-taylor

@tiffany-taylor, to make the white-space-checker happy, you need to squash the commits, and force-push.

cmb69 avatar Nov 09 '22 19:11 cmb69