0

/t5/dreamweaver-discussions/php-question/td-p/1883067
May 25, 2009
May 25, 2009
Copy link to clipboard
Copied
I have this calculation: <?php echo $subTotal + $shipTotal; ?>
where $shipTotal should be 50 if $shipTotal is more or the same as 50.
This is what I have found out so far:
<?php
if ($shipTotal < 50) {
echo $shipTotal;
} elseif ($shipTotal >= 50) {
echo "50";
}
?>
But I don't know how to put it in the calculation (so that $shipTotal is not getting more than 50).
Thankx for any further help and tips.
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
LEGEND
,
May 25, 2009
May 25, 2009
You're nearly there.
<?php
if ($shipTotal >= 50) {
$shipTotal = 50;
}echo $subTotal + $shipTotal;
?>
LEGEND
,
LATEST
/t5/dreamweaver-discussions/php-question/m-p/1883068#M164011
May 25, 2009
May 25, 2009
Copy link to clipboard
Copied
You're nearly there.
<?php
if ($shipTotal >= 50) {
$shipTotal = 50;
}echo $subTotal + $shipTotal;
?>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

