A variable that holds other variables? PHP?

/-=GT=-\

New member
I tried heredocs, but I think heredocs don't support PHP codes.

For example

$php = <<<phpcode
<?php
$var = 'This is a var';
$time = 2;
?>
phpcode;

That didn't work.. how do I hold php codes inside a variable?
Thanks.
But there not like the example above they are much longer variables.. for example..

$roundedtime = round($totaltime,$round);

Would I put that into an array?
Thanks, I keep confusing myself with functions and arrays.
 
what are you trying to do? "A variable that holds other variables" sounds like an array to me.

$php = array("This is a var", 2);

echo $php[0]; // displays "This is a var"
echo $php[1]; // displays 2
 
Back
Top