2013-07-14 70 views

回答

1

首先字符串可以'空',所以沒有什麼。沒事的時候設置,默認設置爲0

整數所以擊穿

if ($somestring != "") // 1 - check to see if the string is not empty 
if ($somestring > 0) // 2 - Check to see of the non-empty string has a value greater than 0 

因此,筆者試圖以防止鬆散型的腳本。

希望這會有所幫助:)

2

可以有字符串「-1」,這將直接評價,分爲-1 INT

關於你的條件 - 首先檢查,如果它不是空的 - 在這種情況下它會evaluted 0貌似作者不希望PHP做到這一點,並要求價值

相關問題