By default, an argument is passed to a function by value. That means that a copy of the data is passed to the function, not the actual data itself.
The arguments (or parameters) of a function can be variables or literals:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN"> <head> <title>PHP</title> <meta Name="Author" Content="Hann So"> </head> <body> <p> <?php function Add($num1, $num2) { echo "$num1 + $num2", $num1+$num2; } Add(5, 15); ?> </p> </body> </html> |