Recently done the project, found an error only variables can is passed by reference, meaning "only variables can be ' referenced '"
is to use a method in the code, the parameter value of this method is referenced by the end method such as PHP
The version of the PHP website
(PHP 4, PHP 5)
End - points The inner pointer of the array to the last cell
Description?MixedEnd( Array
&$array )
End () array moves the internal pointer to the last cell and returns its value.
Parameters?
-
array
-
This array. The array is passed by reference, because it is modified by this function. This means that you must pass in a real variable, not an array returned by the function, because only the real variable can be passed by reference.
return value?
Returns the value of the last element, or if an empty array is FALSE returned.
Incorrect use:
End (Explode (".", $file _name))
The right use
$file _extend = explode (".", $file _name);
End ($file_extend);
Original address: PHP Only variables can is passed by reference
PHP Only variables can is passed by reference