Jump to content

puting for loop in 1 value


canabatz

Recommended Posts

hi ,

 

how do i  put this code in 1 value:

<?php
for ($i=1; $i<=5; $i++)
  {
  echo  $i ;
  }
?>

 

the output will be: 12345

 

how do i put the result in one value ,some thing like :

 

if the result is 12345 then it will be equal to $the_value

 

and when i echo $the_value , the result will be 12345

 

the quastion is how to put the result of the forloop in one value for later use :)

 

thanx

Link to comment
https://forums.phpfreaks.com/topic/185443-puting-for-loop-in-1-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.