Php Interview Question and Answers

29. How would you loop through an array?
  You can loop through an array using the foreach statement.
 
Your Name Your Email-ID
Your Answer
30. How would you sort an associative array by its keys?
  You can sort an associative array by its keys with the ksort() function.
 
Your Name Your Email-ID
Your Answer
31. Which function would you use to open a database using the DBA functions?
  You can open a database with the dba_open() function.
 
Your Name Your Email-ID
Your Answer
32. What regular expression function would you use to replace a matched pattern?
  You can use the preg_replace() function to replace a matched pattern with a given alternative.
 
Your Name Your Email-ID
Your Answer
12345678 Page 8 of 8