self - 就是這個類,是程式碼片段裡面的這個類。 static - PHP 5.3加進來的只得是當前這個類,有點像$this的意思,從堆記憶體中提取出來,訪問的是當前執行個體化的那個類,那麼 static 代表的就是那個類。 還是看看老外的專業解釋吧: self refers to the same class whose method the new operation takes place in. static in PHP 5.3's late
explain select userid from team_enewsmember where agentid in(select userid from team_enewsmember where agentid='2' and levelid>=1 group by userid) and levelid>=1 group by userid 如果主鍵userid與agentid聯合索引就會出現 Using where; Using index 怎麼都去不掉
在開發過程中,函數的傳回值類型應該是確定不變的,但PHP是弱類型的語言,所以PHP是沒有此類語法驗證的,正因為如此,造成了很多坑坑。 比如下面的代碼: 函數getArticles根據不同的條件返回不同類型的值,有bool、int、還有數組,正常情況這類函數是希望返回數組,然後拿數組去做一些其他動作,可因為函數傳回值類型不固定,調用時就很可能產生各種預想不到的坑,因此我就想,既然不能規範,那直接強制好了。 函數/方法傳回值可以強制類型: int function a(){
$sql=mysql_query("select b.userid,b.username,b.card_no,b.buytime,b.commission1,m.level from buybak b left joinmember m on b.userid=m.userid where m.agentid='".$user[userid]."' and b.status1>=0 " ); $array = @mysql_fetch_array($level1_orders);
還記得 Pear OS 嗎?這是個看起來非常像 Mac OS X 的 GNU/Linux 發行版,不過不幸的是,它已經被一家我們現今還不知道名字的大公司所收購了, 官方已經停止 Pear OS 與 Pear Cloud 的下載了 。 去年我們報道過,一位葡萄牙的開發人員 Rodrigo Marques 建立了一個 Pear OS Linux 的複製版,並將其以 PearOS 的名字發布到了 SourceForge 。 當時,這個 PearOS 複製版讓 Pear OS