If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.
Post a reply to the thread: A variable that holds other variables? PHP?
Click here to log in
In what corner do we have Search box?
You may choose an icon for your message from this list
Will turn www.example.com into [URL]http://www.example.com[/URL].
You may rate this thread from 1-star (Terrible) to 5-stars (Excellent) if you wish to do so.
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
A variable that holds other variables? PHP? 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.
A variable that holds other variables? PHP?
Forum Rules