PHP Interview Question and Answers
41. | What do you mean range()? |
---|---|
Starting from a low value and going to a high value, the range() function creates an array of consecutive integer or
character values. It takes up to three arguments: a starting value, an ending value, and an increment value. If only two arguments are given, the increment value defaults to 1. Example : <?php echo range(1,10); // Returns 1,2,3,4,5,6,7,8,9,10 ?> | |
42. | Explain Creating and Naming an Array. | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||
43. | How to read and display a HTML source from the website url? |
---|---|
<?php $filename="http://www.kaptivate.in/"; $fh=fopen("$filename", "r"); while( !feof($fh) ){ $contents=htmlspecialchars(fgets($fh, 1024)); print "<pre>$contents</pre>"; } fclose($fh); ?> |
|
44. | How to display your correct URL of the current web page? |
---|---|
<?php echo $_SERVER['PHP_SELF']; ?> |
|
45. | Explain $_FILES Superglobal Array. | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||