Learn PHP Functions
PHP functions provide a powerful way to break down your code into smaller manageable chunks. The ability to write your own custom functions opens up even more possibilities, but the best way to learn what PHP is capable of is by studying the built-in function library that comes with the language.
The first thing to understand about PHP functions is that it is a loosely-typed programming language. This means that when you pass a value into a function, the PHP engine will figure out what type of data it is (scalar value, array, etc) by itself.
There are two basic types of parameter values that you can pass to a function: scalar values, and arrays. Scalar values can be either a number or a string. Arrays are a group of values that can be accessed by using key values. You can specify the key values for an array by defining a map function within your code.
Another thing to understand is that when you call a function, you will sometimes need to know whether the returned array or variable is going to be a copy of that array, or if it will be a reference to the same array. This is important because it can make a huge difference in how you manipulate the code.
The list() function in PHP is an inbuilt function that can be used to assign the multiple values of an array into one or more variables in a single operation. This is similar to the function called array(), but it works seamlessly on all numerical arrays and not just the key values of an array.