Friday, 22 May 2015

PHP Interview Questions

1.In how many ways we can retrieve the data in the result set of MySQL using PHP ? 
 4

2.Which PHP function returns an array with elements in reverse order?
 array_reverse()

3.The left association operator % is used in PHP for
 modulus

4.Which of the following returns information passed via HTTP forms?
 All of these 

5.Which function allows you to split a string into an array of substrings by a string delimiter?
 explode(" ", $str)

6.After a file is successfully opened in PHP, how do you retrieve a line from the file? 
 fgets

7.The filesize() function returns the file size in ___.
 bytes

8.There is no difference in using the following 2 examples: echo('string'); echo 'string';
 True 

9.What can you use to output a string? 
 both echo and print

10.Which rule determines which sections of script are able to access which variables?
 Variable Scope

11.The PHP statement: $i[2] = "orange"; is an example of
 a numeric array.

12.An array in PHP is an ordered map which associates
 keys to values.

13.Which version of PHP introduced the instanceof keyword?
 PHP 5

14.Give one word: The technique in which when form data contains an SQL escape sequence and inserts a new SQL query to be run is called
 SQL Injection

15.Which function is used to perform a regular expression match in PHP?
 preg_match()

16.In php Which method is used to getting browser properties?
 $_SERVER['HTTP_USER_AGENT']; 

17.What is the value of $var when the following line is executed in a PHP function? unset($var);
 NULL

18.What does the acronym LAMP stand for?
 Linux Apache MySQL PHP/Perl/Python

19.To modify the default PHP settings such as whether to accept the short form open tag (
 php.ini file

20.What is the default size of a file set in upload_max_filesize ?
 2 MB

21.What type of operator is && in PHP?
 logical operator 

22.How do I create PHP arrays in a HTMLTop of Form?
 < input name="MyArray[]" />Bottom of Form

23.Choose the output of the following script. <?php $rest = substr("abcdef", -1); echo $rest; ?>
 f 

24.In order to use session functions, the session_start() call must appear AFTER the
 <?php tag. 

25.OCI8, PostgreSQL, and SQLSRV are all examples of
 database extensions available in PHP. 

26.Which function allows you to specify a start position of a string and length arguments to retrieve part of a string?
 substr() 

27.Which PHP function sorts an array and maintains index association?
 asort() 

28.Which PHP function will combine two arrays?
 array_merge()

29.What is the default execution time set in set_time_limit()?
 30 secs

30.A constructor is a
 Method.
                                                                 Thank You..

No comments:

Post a Comment

Ads Inside Post