OK, all I want to do is run a foreach on an array, but only for the first 5 values. this sounds like it should be standard, but I couldn't find it anywhere on php.net
can someone please help me, my page is sooo close to done.use a for loop instead.. or you can set a counter and add 1 to it at the end of the foreach before it goes through again.
I would use a for loop instead.aright, I looked into for loops and I don't know how to get this array to proceed a key, so I decided to use a while.
what I have is this:while (list(, $value) = each ($list)) && ($a <= '10') {
$path = QWCreateDataPath( $pageName, '.qwiki' );
$then = filemtime( $path );
$delta = QWFormatRelativeDate( $now, $then );
echo "<TR><TD>" . QWFormatQwikiPageName( $pageName ) . "</TD><TD>$delta</TD></TR>\n";
a++;
} I'm getting a parse error on the first line of this (there is nothing of effect above it, it's all html)
do you know how I can vanquish this parse error?and thank you so much for your help scoutt, you've been a massive help with this project. kudos to you while (list(, $value) = each ($list)) && ($a <= '10') {
that is actually invalid. you can't put anything in with a while loop.
for($i=0; $i<=10; $i++){
$path = QWCreateDataPath( $pageName, '.qwiki' );
$then = filemtime( $path );
$delta = QWFormatRelativeDate( $now, $then );
echo "<TR><TD>" . QWFormatQwikiPageName( $pageName ) . "</TD><TD>$delta</TD></TR>\n";
}
you don't even use $list or $value so why the need?erg... sorry, I've just gotten a little lost while doing this, because I've had to leave and come back like 20 times and never really had a chance to concentrate.$list = QWGetRecentlyChangedQwikiPageNameList( ); this is up in the code a ways. QWGetRecentlyChangedQwikiPageNameList is the array I want to print the first 10 values of.$incoherentGibberish = array ("OMG","WOOP","HOOT","HAHAHAHA");
print_r($incoherentGibberish);
echo "all done with that script, thanks again scoutt, for($i=0; $i<=10; $i++) was exactly what i needed";
can someone please help me, my page is sooo close to done.use a for loop instead.. or you can set a counter and add 1 to it at the end of the foreach before it goes through again.
I would use a for loop instead.aright, I looked into for loops and I don't know how to get this array to proceed a key, so I decided to use a while.
what I have is this:while (list(, $value) = each ($list)) && ($a <= '10') {
$path = QWCreateDataPath( $pageName, '.qwiki' );
$then = filemtime( $path );
$delta = QWFormatRelativeDate( $now, $then );
echo "<TR><TD>" . QWFormatQwikiPageName( $pageName ) . "</TD><TD>$delta</TD></TR>\n";
a++;
} I'm getting a parse error on the first line of this (there is nothing of effect above it, it's all html)
do you know how I can vanquish this parse error?and thank you so much for your help scoutt, you've been a massive help with this project. kudos to you while (list(, $value) = each ($list)) && ($a <= '10') {
that is actually invalid. you can't put anything in with a while loop.
for($i=0; $i<=10; $i++){
$path = QWCreateDataPath( $pageName, '.qwiki' );
$then = filemtime( $path );
$delta = QWFormatRelativeDate( $now, $then );
echo "<TR><TD>" . QWFormatQwikiPageName( $pageName ) . "</TD><TD>$delta</TD></TR>\n";
}
you don't even use $list or $value so why the need?erg... sorry, I've just gotten a little lost while doing this, because I've had to leave and come back like 20 times and never really had a chance to concentrate.$list = QWGetRecentlyChangedQwikiPageNameList( ); this is up in the code a ways. QWGetRecentlyChangedQwikiPageNameList is the array I want to print the first 10 values of.$incoherentGibberish = array ("OMG","WOOP","HOOT","HAHAHAHA");
print_r($incoherentGibberish);
echo "all done with that script, thanks again scoutt, for($i=0; $i<=10; $i++) was exactly what i needed";