?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
Answer & Solution
Correct Answer:
Option
C
You can designate certain arguments as optional by placing them at the end of the list and assigning them a default value of nothing.
Join the Discussion
Login to post a comment or share your explanation.
Login