Hi Reader's,
Welcome to FindNerd, today we are going to discuss how to pass arguments to PHP ?
If you want pass some arguments into function and elements of an array.
Then Your arguments will be receive by your function as distinct parameters.
you can see below example:
<?php
//here create a function
function add_message(&$text)
{
//here define a variable of string and pass arguments
$text .= "What's about you ?.";
}
//here another define a variable of string and pass arguments
$string = 'hello Joe i am fine ! ';
//here call function
add_message($string);
//here print youa arguments
echo $string;
?>
The output of the code above will be:
hello Joe i am fine ! What's about you ?
0 Comment(s)