php——學習筆記,對函數的引用和取消引用

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
</head>


<body>
<?php
function &example($tmp=0)
{
return $tmp;
}
$str=&example("騰訊科技");
echo $str."<p>";
?>
</body>

</html>

這裏其實看不出來有啥大用途


取消引用

$num=789;
$math=&$num;
echo"\$math is :".$math."<br>";
unset($math);
echo"\$math is:".$math."<br>";
echo"\$num is:".$num;

只是取消了他們之間的關係,並沒有銷燬內容


發佈了44 篇原創文章 · 獲贊 1 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章