Jnr PHP/Codeigniter Developer Question:

Download Job Interview Questions and Answers PDF

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

Jnr PHP/Codeigniter Developer Interview Question
Jnr PHP/Codeigniter Developer Interview Question

Answer:

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';
}
?>

Download Jnr PHP/Codeigniter Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know how can you enable error reporting in PHP?Do you know what are SQL Injections, how do you prevent them and what are the best practices?