10

目前我有一个看起来像这样的代码:

for ($i=0; $i<=($num_newlines - 1); $i++) 
{
$tweetcpitems->post('statuses/update', 
                    array('status' => wordFilter("The item $parts[$i]  has been released on Club Penguin. View it here:   http://clubpenguincheatsnow.com/tools/swfviewer/items.swf?id=$parts[$id]")));
sleep(90);
}

我想做的是使“i++”部分加二而不是加一,但我该怎么做呢?请帮忙!

4

2 回答 2

37
for ($i=0; $i<=($num_newlines - 1); $i+=2) {
于 2012-05-24T20:54:21.160 回答
6
$i++ : increment by one

$i+=2 : increment by two

$i+=3 : increment by three

ETC..

于 2012-05-24T20:57:50.287 回答