The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hi. How could I get results of following loop to side block on my forum (php/html)
So output 5 times $description : Code:
$limit = 5;
for($x=0;$x<$limit;$x++) {
...random code...
$description = $feed[$x]['desc'];
...random code...
}
$my_output = 'Hello, world.'; return $my_output; But if I add "return $description;", I get only one output cause "return" immediately ends execution of the code. |
|
#2
|
|||
|
|||
|
This will return all 5 descriptions in one shot..
Code:
$limit = 5;
for($x=0;$x<$limit;$x++) {
...random code...
$description .= $feed[$x]['desc'] . '<br />';
...random code...
}
return $description;
Or $description can be returned as an array.. Code:
$limit = 5;
for($x=0;$x<$limit;$x++) {
...random code...
$description[] = $feed[$x]['desc'] .'<br />';
...random code...
}
return $description;
|
| Благодарность от: | ||
| Jerppu | ||
|
#3
|
|||
|
|||
|
Thank you !
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|