Monday, 9 February 2015

Core PHP Interview Questions and Answers for experienced pdf (Page 8)

Below are some important PHP interview questions which are asked in most MNC company interviews for beginners or professionals.

71.What is the difference between PHP4 and PHP5?
PHP4 cannot support oops concepts and Zend engine 1 is used.
PHP5 supports oops concepts and Zend engine 2 is used.
Error supporting is increased in PHP5.
XML and SQLLite will is increased in PHP5.Can we use include(abc.PHP) two times in a PHP page makeit.PHP”?
Yes we can include that many times we want, but here are some things to make sure of:
(including abc.PHP, the file names are case-sensitive) there shouldn’t be any duplicate function names, means there should not be functions or classes or variables with the same name in abc.PHP and makeit.php

72.What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?
mysql_fetch_array – Fetch a result row as an associative array and a numeric array.
mysql_fetch_object – Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows mysql_fetch_row() – Fetches one row of data from the result associated with the specified result
identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.

73.What is meant by nl2br()?
nl2br() inserts a HTML tag <br> before all new line characters \n in a string.
echo nl2br(“god bless \n you”);
god bless<br>

74.How can we encrypt and decrypt a data presented in a table using MySQL?
You can use functions: AES_ENCRYPT() and AES_DECRYPT() like:
AES_ENCRYPT(str, key_str)
AES_DECRYPT(crypt_str, key_str)

75.How can I retrieve values from one database server and store them in other database server using PHP?
For this purpose, you can first read the data from one server into session variables. Then connect to other server and simply insert the data into the database.Who is the father of PHP and what is the current version of PHP and MYSQL?
Rasmus Lerdorf.
PHP 5.1. Beta
MySQL 5.0

76.In how many ways we can retrieve data in the result set of MYSQL using PHP?
mysql_fetch_array – Fetch a result row as an associative array, a numeric array, or both mysql_fetch_assoc – Fetch a result row as an associative arraymysql_fetch_object – Fetch a result row as an object mysql_fetch_row —- Get a result row as an enumerated array

77.What are the functions for IMAP?
imap_body – Read the message body
imap_check – Check current mailbox
imap_delete – Mark a message for deletion from current mailbox
imap_mail – Send an email message

78.What are encryption functions in PHP?

79.What is the difference between htmlentities() and htmlspecialchars()?
htmlspecialchars() – Convert some special characters to HTML entities (Only the most widely used)
htmlentities() – Convert ALL special characters to HTML entities

80.What is the functionality of the function htmlentities?
htmlentities() – Convert all applicable characters to HTML entities
This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all
characters which have HTML character entity equivalents are translated into these entities.
More Questions & Answers :-
Page1  Page2  Page3  Page4  Page5  Page6  
Page7  Page8  Page9  Page10

No comments:

Post a Comment