I'm reading php.net in order to get acquainted with new functions. I'm very newbie in learning any programming language, and when I read how any function's syntax is explained, it's not easy for me. ie: array_unshift() I get this:
int array_unshift(array array, mixed variable [,mixed variable...])
I read some examples, but I can't understand a priori [ed note: not having any prior knowledge] how the syntax works reading only the theoretical explanation. I haven't found any other question related to this.
You've misquoted the function definition, it is:
int array_unshift ( array &$array , mixed $value1 [, mixed $... ] )
which equates to:
return_type function_name ( type_hint $arg_name , type_hint $arg_name [, type_hint $...] )
where ... means it will accept as many more arguments as you want to throw at it.
This can easily be narrowed done to the following
intarray_unshiftarrayarraymixed (multiple types possible)variableYou can read more about the types in the manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With