HOw do I limit array to a certain number??

Posted by mathew on Stack Overflow See other posts from Stack Overflow or by mathew
Published on 2010-06-10T17:26:07Z Indexed on 2010/06/10 17:32 UTC
Read the original article Hit count: 222

Filed under:
|

I do have an array which queries database..what I need to do is control this array to a certain number say 10. but I dont want to set LIMIT in mysql query I need to leave that as it is...

$result = mysql_query("SELECT * FROM query ORDER BY regtime DESC");
while($row = mysql_fetch_array($result))
{
  echo "<img src='bullet.gif' align='absmiddle' class='col1ab'><a class='col1ab' href=".$row['web']." >www.".$row['web']."</a><br>";
}

How do I limit this array to certain limit??

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql