Friday, July 28, 2017

PHP Interview Question And Answer For Fresher


Here I have give the list of php question and their answer. That are mostly asked in interview as a fresher.

Q1. What is PHP?
Ans: The PHP Hypertext Preprocessor (PHP) is a  widely-used open source general-purpose scripting language that allows web developers to create dynamic content that interacts with databases.

Q2. Which Programming language does PHP resemble to?
Ans: PHP syntax resembles Perl and C.

Q3. The Latest PHP Version?
Ans: The PHP development team announces the immediate availabililty of PHP 7.2.0 Beta 1.

Q4. What are the correct way for start the php code and finish it?
Ans.The two most  common ways to start and finish a PHP script are: <?php [   —  PHP code—- ] ?> and <? [—  PHP code  —] ?>

Q5. How can PHP and HTML interact?
Ans. It is possible to generate HTML through PHP Scripts, and it is possible to pass information from HTML to PHP.

Q6. What are the functions to be used to get the images properties's(size, width and height)?
Ans. The function are getimagesize() for  getting size of images, imagesx() for getting the width of image and imagesy() for getting the hieght of images.

Q7. How failures in execution are handled with include() and require() functions?
Ans. If the function require() cannot access to the file then it ends with a fatal error. However, the include() function gives a warning and the PHP script continues execute.

Q8. How can we display information of a variable and readable by human with PHP?
Ans. The set_time_limit(0) added at the beginning of a script sets to infinite the time of execution to not have the PHP error ‘maximum execution time exceeded’.It is also possible to specify this in the php.ini file.

Q9. How can we check the value of a given variable is a number ?
Ans.It is possible to use the dedicated function, is_numeric() to check whether it is a number or not.


Q10How can we check the value of a given variable is alphanumeric?
Ans.It is possible to use the dedicated function, ctype_alnum to check whether it is an alphanumeric value or not.

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...