Jump to content

[SOLVED] $row and array help!!


clown99

Recommended Posts

Evening all,

 

hoping one of you could help me with a little problem i'm having, (very new to PHP you see). Basically, I need to display the results from an array that is automatically created. Easy enough.

 

But the problem I'm having is that the array will be changing in size, so how do I get it to only display rows with contents in them?

 

At the moment I've go this. But it only displays 10 rows. If the array shrinks, it errors on the empty ones and if it grows it'll miss some. Obviously I can increase it but then it displays all the empty ones, (before I knew this I set it to infinity, wow, had displayed error messages for  120,000 rows before I managed to stop it!! ;D)

 

Any help appreciated

 

for ($row = 0; $row < 10 ; $row++)
{
echo "<li>".$matches[$row][1]."</li>";
}

 

 

Link to comment
https://forums.phpfreaks.com/topic/149187-solved-row-and-array-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.