1
對象的號碼,我想按照這個模式來打印對象的數量打印:如何根據PHP
If there is 1 object, print 0
If there is 2 objects, print 0 1
If there is 3 objects, print 0 1 2
我嘗試下面的代碼:
for($i = count($nodes) ; $i >= 0 ; $i--){
print $i;
}
但結果是:
If there is 1 object, print 0 1
If there is 2 objects, print 0 1 2
if there is 3 objects, print 0 1 2 3
哪我不能使用。我怎樣才能做到這一點?
知府,謝謝。 – Zim3r