On Tue, August 1, 2006 12:49 pm, bob pilly wrote:
> Does anyone know if you can assign a new variable name based on the
> contents of another variable in PHP? If so whats the syntax to do
> this?
You can and it's called Variable Variables in the documentation...
99% of the time, it's better to us
At 02:49 PM 8/1/2006, bob pilly wrote:
Hi all
Does anyone know if you can assign a new variable name based on the
contents of another variable in PHP? If so whats the syntax to do this?
I am parsing a text file that has tens of preset attributes and some of
these have hundreds of sub attri
Bob Pilly asked earlier today:
> Does anyone know if you can assign a new variable name based on the
contents of another variable in PHP? If so whats the syntax to do this?
$counter = 1;
for ($i == 0; $i < 6; $i++) {
${'newVar_' . $counter} = $counter;
$counter++;
}
echo $newVar_1 .
Hi Bob,
Based on what you said, I would say the normal coding way of handling
this is with an array.
If you are unfamiliar with them, www.php.net/array would be a good place
to start.
-Brad
bob pilly wrote:
Hi all
Does anyone know if you can assign a new variable name based on the contents
Hi all
Does anyone know if you can assign a new variable name based on the contents of
another variable in PHP? If so whats the syntax to do this?
I am parsing a text file that has tens of preset attributes and some of these
have hundreds of sub attributes. For example the text file contains f
5 matches
Mail list logo