Tuesday, August 13, 2013

PHP MCQ with answers solved

1. What does PHP stand for?

a) Personal Home Pages
b) Private Home Page
c) Personal Hypertext Processor
d) Hypertext Pre-processor            

Ans : d


2. PHP server scripts are surrounded by delimiters, which?

a) <?php>...</?>
b)<?php…?>
c) <&>...</&>
d) <script>...</script>              

Ans : b


3. How do you write "Hello World" in PHP?
a) "Hello World";
b) echo "Hello World";
c) Document.Write("Hello World");  
    
Ans : b


4. All variables in PHP start with which symbol?

a) $
b) !
c) &      
       
Ans : a


5. What is the correct way to end a PHP statement?

a) </php>  
b) New line
c) ;    
d) .        
 
Ans : c


6. The PHP syntax is most similar to:

a) Perl and C
b) JavaScript
c) VBScript

Ans : a


7. How do you get information from a form that is submitted using the "get" method?

a) Request.Form;
b) Request.QueryString;
c) $_GET[];                  

Ans : c


8.When using the POST method, variables are displayed in the URL:

a) True
b) False                  

Ans : b


9.In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:

a) True
b) False                  

Ans : a


10.Include files must have the file extension ".inc"

a) False
b) True                    

Ans : b


11.What is the correct way to include the file "time.inc" ?

a) <!--include file="time.inc"-->
b) <% include file="time.inc" %>
c) <?phpinclude_file("time.inc"); ?>
d) <?php require("time.inc"); ?>            

Ans : d


12.What is the correct way to create a function in PHP?

a) createmyFunction()
b) new_functionmyFunction()
c) functionmyFunction()
d) None of these                

Ans : c


13.What is the correct way to open the file "time.txt" as readable?

a) fopen("time.txt","r");b) open("time.txt");
c) fopen("time.txt","r+");  d) open("time.txt","read");        

Ans : a


14.PHP allows you to send emails directly from a script

a) True
b) False                    

Ans : a


15.What is the correct way to connect to a MySQL database?

a) dbopen("localhost");
b) mysql_open("localhost");
c) mysql_connect("localhost");
d) connect_mysql("localhost");              

Ans:c


16.What is the correct way to add 1 to the $count variable?

a) $count++;
b) count++;
c) $count =+1
d) ++count                  

Ans: a


17.What is a correct way to add a comment in PHP?

a) /*…*/
b) <!--…-->
c) *\..\*
d) <comment>…</comment>              

Ans : a


18.PHP can be run on Microsoft Windows IIS(Internet Information Server):

a) False
b) True                    

Ans : b


19.In PHP, the die() and exit() functions do the exact same thing.

a) False
b) True                    

Ans : b


20.Which one of these variables has an illegal name?

a) $my-Var
b) $myVar
c) $my_Var
d) None of these                

Ans : a

Related Posts:

  • Computer Fundamental 100 Solved MCQ Part-3Question: 1. Bit map terminalOption A. support display containing multiple windowOption B. require considerable amount of video RAMOption C. requires tremendous amount of copying and hence low performanceO… Read More
  • Computer Fundamental 100 Solved MCQ Part-5Question: 1. First generation computers used_____ for memoryOption A. vacuum tubesOption B. silicon chipsOption C. magnetic drumOption D. RAMQuestion: 2. Which of the following memories allows si… Read More
  • Computer Fundamental 100 Solved MCQ Part-6Question: 1. When was the company named IBM?Option A. 1914Option B. 1924Option C. 1975Option D. None of aboveQuestion: 2. Which of the following storage device can store the largest amount of dat… Read More
  • Computer Fundamental 100 Solved MCQ Part-7 Question: 1. What type of device is computer keyboard?Option A. MemoryOption B. OutputOption C. StorageOption D. InputQuestion: 2. Which is the limitation of high level language?Option A.&n… Read More
  • Computer Fundamental 100 Solved MCQ Part-4Question: 1. Which statement is valid about computer program?Option A. It is understood by a computerOption B. It is understood by programmerOption C. It is understood userOption D. Both a & bQues… Read More

9 comments:

  1. tks bạn, cố gắn đăng thêm nữa cho mọi người cùng xem

    ReplyDelete
  2. "Nice and good article.. it is very useful for me to learn and understand easily.. thanks for sharing your valuable information and time.. please keep updating.php jobs in hyderabad.
    "

    ReplyDelete
  3. All the questions have been Copied from w3school

    ReplyDelete