Hi There,
Can any one give me a few pointers of reducing code in PHP.
I'm pulling some data from a database and I need to format each line returned for example it pulls a figure for jan, feb, mar etc then formats it i.e. ;
$jan = odbc_result($sql_result, 4);
if ($jan > 0) {
$jan = number_format($jan, "2",".",",") ;
}
if ($jan >= 2.50) {
$font = "font face='Arial' style='font-size: 9pt; font-weight:700' color='#FF0000'" ;
}
else $font = "font face='Arial' style='font-size: 9pt'" ;
rather than repeat all this code for $feb, $mar etc, could i use a function to do this for me?
Cheers for any pointers!