| 目次 |
|---|
|
・PHPの関数 ・引数の参照渡し ・Cannot redeclare |
function 関数名(引数...){
}
<?php
$msg = "test";
print_msg($msg);
function print_msg($msg){
echo $msg;
}
?>
test
function 関数名(&$param1,&$param2){
}
<?php
$msg1 = "test";
print_msg2($msg1);
echo $msg1;
function print_msg2(&$msg1){
$msg1 = "test2";
}
?>
test2