I am new to PHP, I do not write php in function format. But I think lot of people do. Unless function needs to be used at different pages, what is the use of write php code in a function?
********
function total() {
return sprintf( "%.2f", $this->info[ 'quantity' ] * $this->info[ 'pricing' ] + $this->info[ 'setupcost' ] );
}
function display_line_item( $suffix=' )
{
// print some crap
}
}
**********
********
function total() {
return sprintf( "%.2f", $this->info[ 'quantity' ] * $this->info[ 'pricing' ] + $this->info[ 'setupcost' ] );
}
function display_line_item( $suffix=' )
{
// print some crap
}
}
**********