Jump to content

making variable from variables


bugcoder

Recommended Posts

Hi,

 

This might be basics of php but i haven't come across this situation before.

 

$sumQuarter_1 = 121;

$sumQuarter_2 = 223;

........so on

 

later somewhere in code i have variable having just 1, 2 etc only

 

e.g

$quarterNumber = 2;

 

now how can I get the value dynamically from $sumQuarter_2 as I can't use

 

echo  $sumQuarter_$quarterNumber;

 

-------------

I hope my question is clear enough. ::)

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/268547-making-variable-from-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.