puting for loop in 1 value


Posted on 16th Feb 2014 07:03 pm by admin

hi ,

how do i put this code in 1 value:
Code: <?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

No comments posted yet

Your Answer:

Login to answer
305 Like 10 Dislike
Previous forums Next forums
Other forums

How to generate a random array of integers subject to a certain constraint
I am writing a program that asks the user to enter an integer N and then generates a random array of

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

Basic Forum Tutorial
Hi, I'm new to PHP. I want to build a basic forum for my site using PHP and MySQL. I've searched t

Character Sets/Collations Stuff
Can someone please give me a check list of things I must do to setup all the charset stuff for my ph

Remove values in array2 from array1
I have two arrays.

Array 1 is where the array key holds various different numbers. For exampl

Sql and php order list script problems
Hi im having a few problems with trying to get the coding right on a orders list ive done (or trying

an interesting question
Greetings folks, got to ask an interesting question...

let say
i have created a function s

php call servlet
I have done a php backup application .
So there is a form that user pick some files to zip and d

Beginner PHP code help
Hi I'm new to php but if someone could please read the question below and help it would be great.

Two warning messages
Quote<b>Warning</b>: mysql_real_escape_string() expects parameter 1 to

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash