php實現遞歸的方法有3種:
1.利用引用做參數,代碼為【$result[]=$a;test($a,$result)】。
2.利用全局變量完成遞歸函數。
3.利用靜態變量,代碼為【static $count=0;】。