Php Interview Question and Answers
29. |
How would you loop through an array? |
|
You can loop through an array using the foreach statement. |
|
|
30. |
How would you sort an associative array by its keys? |
|
You can sort an associative array by its keys with the ksort() function. |
|
|
31. |
Which function would you use to open a database using the DBA functions? |
|
You can open a database with the dba_open() function. |
|
|
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. |
|
|