I am trying to make a variable inside a loop from another variable. For example:
inside the loop I have variable $currentrow that tells me which row the loop is on
I want to make a variable named $news_[value of current row]
so when $currentrow is 5, it makes a variable $news_5.
How do I go about doing this?
Thanks,
Jon
Creating a variable with a variable
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
why not use arrays?
for "dynamic" variable create read the documentatio on variable variables: http://www.php.net/manual/en/language.v ... riable.php
for "dynamic" variable create read the documentatio on variable variables: http://www.php.net/manual/en/language.v ... riable.php