$current_month = date('M');
for($m=1; $m<=$current_month; ++$m)
{
$monthNamelower=strtolower(date('M', mktime(0, 0, 0, $m, 1))).'';
if ($jandata!='')
{
echo $jandata;
}
echo $data2jan;
}
can i replace the month jan with the variable $monthNamelower?
I tried something like this but not working
if ('$'.$monthNamelower.'data'!='')
{
echo '$'.$monthNamelower.'data';
}
echo '$data2'.$monthNamelower;

$monthNamelower .= 'data'; if (${$monthNamelower}) { }$jandataout? Maybe you would better use an array to store your data without using variables of variables (and if your data are already in place compact is your best friend!)