Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Social Networking And Marketing Interviews:Digital Marketing ManagerNews And Article WritersOnline Media OperatorPHP Community Marketing ExpertPublic Relations AssistantPublic Relations ManagerSMMSocial MediaSocial Media ExecutiveSocial Media Specialist
Copyright © 2018. All Rights Reserved
PHP Community Marketing Expert Interview Question:
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
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.