let's get the output of a loop in a variable, i am trying to return data in a for loop. Here is the code:
<?php
for($i=0,$j=0; $i<=10, $j<=10; $i++,$j++){
$data = "$i and $j<br>";
return $data;
}
echo $data;
?>
Here is the code http://codepad.org/qqnGdjS7
so, how return data in php for loop, so there is ways to use loop data outside of the loop!