September 6th, 2000, 02:54 PM
if i am trying to make a variable $day_' . $i . ' and i have $i in a for ($1=1;$i<31; ++$i) - how do i get the variable $day_ to have the $i variable on the end? (the above doesnt work btw)
I want to be able to have
$day_1 = Monday
$day_2 = Tuesday etc. Kinda thing - where i dont have to define 1,2,3,4
September 6th, 2000, 03:32 PM
I think what your after is:
September 6th, 2000, 05:50 PM
Um, I think you should use an array.
Curious, are you learning PHP after learning flash?
September 7th, 2000, 04:37 AM
Try something like this :
You wil not have to defin 1234 i.e for sure.
** Expertise comes with experiece ** Nikunj
September 7th, 2000, 06:19 AM
You can have a variable in a variable by using the following syntax:
The variable $day could then be defined as follows:
$day = "day_$i;
$$day = "something";
I hope this is what you need,
Boradoli Web Design
September 9th, 2000, 06:01 PM
Thank you kindly all
I tried almost identical code to the one you suggested Ramon, but it didnt work. In the end i couldnt use the variable variable for what i wanted to do, but i do greatly appreciate your time.
Rod, if you mean Lingo, the Director language - yups i have learnt that also - has been a while though - not sure how it was relevant to the way i had tried to explain what i was trying to achieve though ...
September 9th, 2000, 07:30 PM
Can't you use the eval() function to do this?
That should work to create the variable.