Tell me how would you declare a function that receives one parameter name hello?
Submitted by: MuhammadIf 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
<?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
Top PHP Community Marketing Expert Questions
☺ | Tell me what does the following code output? |
☺ | Tell me how would you declare a function that receives one parameter name hello? |
☺ | Tell me what is the output of the following code: |
☺ | Explain do you use Composer? If yes, what benefits have you found in it? |
Top Social Networking And Marketing Categories
☺ | SMM Interview Questions. |
☺ | Social Media Interview Questions. |
☺ | Online Media Operator Interview Questions. |
☺ | PHP Community Marketing Expert Interview Questions. |
☺ | Social Media Executive Interview Questions. |