Home  >  Q&A  >  body text

Please tell me where is the error? As long as I run it in the browser, I get an error.

<?php

function one($aa){


## return $aa;

}

echo one(aa:'ccc');

?>

As long as it is run in the browser, an error will be reported

钱难有钱难有2013 days ago981

reply all(3)I'll reply

  • 三叶草

    三叶草2019-05-11 20:16:56

    PHP uses "." as the connector, and the variable aa in your echo one(aa:'ccc'); is not declared, or define ('aa',111); defines a constant

    reply
    0
  • 钱难有

    钱难有2019-05-10 16:59:18

    Still reporting an error

    reply
    0
  • 何子健

    何子健2019-05-10 15:42:28


    <?php 
    function one($aa){
    return $aa;
    };
    $array = array("aa" => "ccc");
    print_r (one($array)['aa']);
     ?>
     你试试这样 ,你传的参数有问题不能直接这样传,你要那样子的话只能转换成数组或对象,就像上面一样


    reply
    0
  • Cancelreply