PHP函数数学

PHP函数数学,php,function,math,echo,Php,Function,Math,Echo,我必须创建一个PHP代码,用2个数字调用函数,并使用echo语句显示函数返回值。到目前为止,我只有贝娄。不知道我在哪里搞砸了,或者我需要补充什么。只是卡住了 <?php function myfunction( $argx = 5 , $arg4 = 4) { return ($argx * $arg4); } echo ($argx * $arg4); 试着这样做: <?php // +------------------ myfunction

我必须创建一个PHP代码,用2个数字调用函数,并使用echo语句显示函数返回值。到目前为止,我只有贝娄。不知道我在哪里搞砸了,或者我需要补充什么。只是卡住了

 <?php 

function myfunction( $argx = 5 , $arg4 = 4) {

return ($argx * $arg4);


}

echo ($argx * $arg4);
试着这样做:

<?php
//            +------------------ myfunction is the function name
//            |       +---------- $argx is a parameter with the default value 5
//            |       |        +- $arg4 is a parameter with the default value 4
//            |       |        |
function myfunction($argx=5, $arg4=4) {
    return ($argx * $arg4);
}

例如,您所做的功能现在可以用于

echo myfunction(7,8);
如果你这么做的话

echo myfunction();
这将是一样的

echo myfunction(5,4);
因为您已经将这些值设置为默认值

读入PHP函数,例如。

请阅读任何随机的PHP教程,这里不是学习PHP的地方。
echo myfunction(5,4);