Length of array
Moderator: General Moderators
Length of array
I was wondering how you check the length of an array, either that or the posibility of using somthing that will stop looping when an array ends?
Sorry, I'm a muppet. Just found a solution.
sizeof seems to do the job fine
Code: Select all
$category_ID = $connector->query_column("SELECT category_ID FROM gallery_category");
$category_name = $connector->query_column("SELECT category_name FROM gallery_category");
$category_description = $connector->query_column("SELECT category_description FROM gallery_category");
$category_URL = $connector->query_column("SELECT category_URL FROM gallery_category");
$preview = $connector->query_column("SELECT category_preview FROM gallery_category");
$i = 0;
$n = sizeof($category_name);
echo "<table border='1'>";
for($i=0; $i<$n; $i++)
{