Not very good with PHP and have been struggling with how you can make an if statement inside an array but after some research I understand that it's not possible to do, so how would you do if you want to check if the value of the array is bigger than, for example 100 and if it is then multiply that value with 0.75 and if it's not just keep the value as it is in the array.
It's in the second subtable array where I make som calculations that I want to be able to check the value and then if necessary multiply it... Any help would be greatly appreciated!
function details($parameters, $result) {
$table = array();
$subtable = array();
$table[] = array("title" => get_text("details_0") . getInformation($parameters),
"rows" => &$subtable);
$subtable[] = array("title" => get_text("details_1_2"),
"value" => round($result->pris) . get_text("details_price"),
"collapsible" => false,
"tooltip" => array(
"title" => get_text("details_1_2_title"),
"content" => get_text("details_1_2_content")));
$subtable[] = array("title" => get_text("details_1_4"),
"value" => (round(12 * $result->varde / $result->sin) + round($parameters["extra"] * 0.106)) * $parameters["regel"] . get_text("price"),
"collapsible" => false,
"tooltip" => array(
"title" => get_text("details_1_4_title"),
"content" => get_text("details_1_4_content")));
$subtable[] ... more subtablearrays
return $table;
}
if ($value > X) $value = Y;