function alert($type=5) {
if ($type==1){
return "num is equal to 1 ";
}
else {
return " Bigger than 1";
}
}
echo alert(1);
?>
Passing arguments by reference ¶
To have an argument to a function always passed by reference, prepend an ampersand (&) to the argument name in the function definition:
<?phpfunction alert(&$type=5) {
$type +=6;
if ($type==1){
return "type is equal to 1 ";
}
else {
return " $type Bigger than 1";
}
}
echo alert();
No hay comentarios:
Publicar un comentario