I have a function geturls() that returns $urls as array
$urls[1] $urls[2] .....$urls[44]
However I don't know count of $urls (sometimes 44 45 77 ....)
And I want to make a loop for many times (44 in this case but could change)
So here is my script
function geturls($xml){
//my function
}
$urls = geturls($xml);
$counti = count($urls);
for ($i = 1; $i <= $counti; $i++) {
$modifiedurl = modify($urls[$i]);
echo $modifiedurl;
}
Is there a better way to do this (I'm sure there is a better way without using count() )?