PHP Interview Question and Answers

21. What is the difference between the functions unlink and unset?
  unlink() deletes the given file from the file system.
unset() makes a variable undefined.
 
Your Name Your Email-ID
Your Answer
22. What is the difference between ereg_replace() and eregi_replace()?
  eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when matching alphabetic characters.
 
Your Name Your Email-ID
Your Answer
23. What is the difference between characters \023 and \x23?
  The first one is octal 23, the second is hex 23.
 
Your Name Your Email-ID
Your Answer
24. 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.
 
Your Name Your Email-ID
Your Answer
25. 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.
 
Your Name Your Email-ID
Your Answer