Q: What does PHP stand for? i) Personal Home Page ii) Hypertext Preprocessor iii) Pretext Hypertext Processor iv) Preprocessor Home Page
Solution: PHP previously stood for Personal Home Page now stands for Hypertext Preprocessor.
Q: PHP files have a default file extension of_______
Solution: To run a php file on the server, it should be saved as AnyName.php
Q: What should be the correct syntax to write a PHP code?
Solution: Every section of PHP code starts and ends by turning on and off PHP tags to let the server know that it needs to execute the PHP in between them.
Q: Which of the following is/are a PHP code editor? i) Notepad ii) Notepad++ iii) Adobe Dreamweaver iv) PDT
Solution: Any of the above editors can be used to type php code and run it.
Q: Which of the following must be installed on your computer so as to run PHP script? i) Adobe Dreamweaver ii) XAMPP iii) Apache and PHP iv) IIS
Solution: To run PHP code you need to have PHP and a web server, both IIS and Apache are web servers. You can choose either one according to your platform.
Q: Which version of PHP introduced Try/catch Exception?
Solution: PHP 5 version and later versions added support for Exception Handling.
Q: How should we add a single line comment in our PHP code? i) /? ii) // iii) # iv) /* */
Solution: /* */ can also be use to comment just a single line although it is used for paragraphs. // and # are used only for single line comment.
Q: Which of the following PHP statement/statements will store 111 in variable num? i) int $num = 111; ii) int mum = 111; iii) $num = 111; iv) 111 = $num;
Solution: You need not specify the datatype in php.
Q: What will be the output of the following PHP code?
Solution: .(dot) is used to combine two parts of the statement. Example ($num . “Hello World”) will output 1Hello World.
Q: What will be the output of the following PHP code?
Solution: The numbers inside the double quotes are considered as integers and not string, therefore the value 3 is printed and not 1+2.
You Have Score    | /10 |