php question
php question
- Started
- Last post
- 5 Responses
- Lillebo0
Clean thy code.
- Lillebo0
$price = 500;
$price = $price . " + " . ($price / 10);
// $price echoes "500 + 50"$price = 500;
$price = $price . " + (" . $price . "/10)";
// $price echoes "500 + (500/10)"
- quamb0
exactly.
Though need to incorporate it into the below.if($rsOptionvalue[$k]->fPrice>0)
{
$optName.="".CONST_CURRENCY.
number_format($rsOptionvalue[$k...
}
- quamb0
stupid keeps cutting off...
if($rsOptionvalue[$k]->fPrice>0)
{
$optName.="".CONST_CURRENCY.
number_format($rsOptionvalue
[$k]->fPrice,2);
}
- neverblink0
if(0 < $rsOptionvalue[$k]->fPrice){
// step 1; get Price (remove space before [$k])
$price = number_format($rsOptionvalue [$k]->fPrice, 2);
// step 2; add Price/10
$price = $price . " + (" . $price . "/10)";
// step 3; add currency
$price = CONST_CURRENCY . $price;
}