摘要:
php中定义了一些超全局的变量 $GLOBALS$_SERVER$_GET$_POST$_FILES$_COOKIE$_SESSION$_REQUEST$_ENV 具体的使用请参考 http://php.net/manual/zh/language.variables.superglobals.ph 阅读全文
posted @ 2018-03-20 21:34 sishuisufeng 阅读(111) 评论(0) 推荐(0) 编辑
|
|
摘要:
php中定义了一些超全局的变量 $GLOBALS$_SERVER$_GET$_POST$_FILES$_COOKIE$_SESSION$_REQUEST$_ENV 具体的使用请参考 http://php.net/manual/zh/language.variables.superglobals.ph 阅读全文
posted @ 2018-03-20 21:34 sishuisufeng 阅读(111) 评论(0) 推荐(0) 编辑
摘要:
function &example($tmp=0){ //定义一个函数,别忘了加“&”符 return $tmp; //返回参数$str } $str = &example("看到了"); //声明一个函数的引用$str1; echo $str."<p>"; 我感觉这相当于直接调这样调用 examp 阅读全文
posted @ 2018-03-20 17:31 sishuisufeng 阅读(217) 评论(0) 推荐(0) 编辑
摘要:
这个东西相当于C语言中的函数指针,C#里的委托 function come() { //定义com函数 echo "来了<p>"; } function go($name = "jack") { //定义go函数 echo $name."走了<p>"; } function back($string 阅读全文
posted @ 2018-03-20 17:15 sishuisufeng 阅读(2474) 评论(0) 推荐(0) 编辑
摘要:
传值 function example( $m ){ $m = $m * 5 + 10; echo "在函数内:\$m = ".$m; } $m = 1; example( $m ) ; echo "<p>在函数外:\$m = $m <p>" ; function example( $m ){ $m 阅读全文
posted @ 2018-03-20 16:52 sishuisufeng 阅读(349) 评论(0) 推荐(0) 编辑 |
|