string $myArray [] = {"one","two","three","four"};
int $myArraySize = size($myArray);
for ($i =0; $i<$myArraySize; $i++)
{
if ($myArray[$i] == "one")
print ("\n"+$myArray[$i] + " dead roach!");
else
print ("\n"+$myArray[$i] + " dead roaches!");
}
returns:In this example I included an imbedded funcion of mayas called size(). When you want to find the size of a given array use size(arrayname);. This comes in handy in situations such as the one above. We have an array, we are not sure the size of the array, but we want a loop to happen based on the size of that array.