I have a 3rd party script that loops through every returned value and echos it.
I want to limit the amount to 3 loops but am having issues.
current loop:
foreach($json->data as $v)
{
echo $v->from->name."<br>";
}
I want to do something like:
for ($i=0;$i<3;$i++)
{
echo $v->from->name."<br>";
}
Is there any work around without having to rework the whole script.
If $json is a integer-indexed array (although I doubt it)
otherwise a less elegant solution would be
finally