I saw some function declarations like this:
function boo(&$var){ ... }
what does the &
character do?
Information Technology (IT) is used in business for transmitting, storing, manipulating and retrieving data. The purpose of IT used in business are: Information Technology helps to store the information.
Purpose is defined as to plan or intend to do something. An example of purpose is someone deciding they will start saving 10% of their income. An object to be reached; a target; an aim; a goal. A result that is desired; an intention.
All life forms have one essential purpose: survival. This is even more important than reproduction. After all, babies and grannies are alive but don't reproduce. To be alive is more than passing genes along.
The purpose of a text is simply the writer's reason for writing. Many texts have more than one purpose, but usually one will stand out as primary. Readers have the job of determining the purpose or purposes of a text and understanding why the writer is writing and what the writer wants the reader to do with the text.
It's a pass by reference. The variable inside the function "points" to the same data as the variable from the calling context.
function foo(&$bar) { $bar = 1; } $x = 0; foo($x); echo $x; // 1
Basically if you change $var
inside the function, it gets changed outside. For example:
$var = 2; function f1(&$param) { $param = 5; } echo $var; //outputs 2 f1($var); echo $var; //outputs 5
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