Tell me how would you declare a function that receives one parameter name hello?

Submitted by: Muhammad
If hello is true, then the function must print hello, but if the function doesn’t receive hello or hello is false the function must print bye.

<?php
function showMessage($hello=false){
echo ($hello)?'hello':'bye';
}
?>
In this question, the interviewer can evaluate if the developer knows how to declare a function and how they would manage the fact of the parameter can or cannot be on the function call. The interviewer can also evaluate if the developer knows the if syntax and if they knows how to print text(echo function).
Submitted by: Muhammad

Read Online PHP Community Marketing Expert Job Interview Questions And Answers