|
Page 1 of 2
ormal"> PHP is now very demanding web development language in comparision of others. This is only due to open source and very rapid development. Below are some frequently asked interview questions of php generally asked in any companies technical interview. Q1) What is PHP ? Ans: PHP also termed as Hypertext preprocessor is a Server-side HTML embedded scripting language. Q2) How can we get second of the current time using date function? Ans: <?php echo $second = date("s"); ?> Q3) How can we know the number of elements in an array using php? Ans: There are two ways: 1) sizeof($myarray) - This function is an alias of count() Q4) What are the different functions in sorting an array? Ans: asort() arsort() ksort() krsort() uksort() sort() natsort() Q5) What would the following code print to the browser? And Why? Ans: <? $num = 10; function multiply() { $num = $num * 10; } multiply(); echo $num; Q6) What is mean by LAMP? Ans: LAMP is the combination of Linux, Apache, MySQL and PHP. Q7) How can you get round the stateless nature of HTTP using PHP? Ans: using Sessions in PHP Q8) What function can you use to open a file for reading and writing? Ans: fopen(); Q9) What function would you use to redirect the browser to a new page? Ans:header() Q10) Are PHP function names casesensitive? Ans: No, It is not case sensitive functions.
|