PHP Basics Aptitude Questions and Answers

PHP Basics Aptitude Questions and Answers: This section contains aptitude questions and answers on PHP Basics.
Submitted by Nidhi, on May 22, 2020

This section contains Aptitude Questions and Answers on PHP Basics.

1) There are the following statements that are given below, which of them are correct PHP?
  1. PHP stands for the Preprocessor Home page.
  2. PHP is a scripting language.
  3. PHP is a client-side hypertext language.
  4. PHP is used to make dynamic and interactive pages.

Options:

  1. A and C
  2. B and D
  3. A, B, and C
  4. A, B, C, and D

2) PHP stands for?
  1. Preprocessor Home Page
  2. Personal Home Page
  3. Hypertext Preprocessor
  4. Preprocessor Hypertext Page

Options:

  1. A and B
  2. A and C
  3. B and C
  4. C and D

3) Can we create a web-service in PHP?
  1. Yes
  2. No

4) What is the extension is used for PHP scripting files?
  1. .php
  2. .ph
  3. .p
  4. .phtml

5) Can we generate an executable file after the compilation of PHP code?
  1. Yes
  2. No

6) Which of the following are popular frameworks used in PHP?
  1. CakePHP
  2. FuelPHP
  3. Zend
  4. Yii

Options:

  1. A and B
  2. C and D
  3. A, B, and C
  4. A, B, C, and D

7) A PHP file can contain?
  1. HTML code
  2. Windows Application code
  3. Java-script code
  4. PHP code

Options:

  1. A and B
  2. A, B, and C
  3. A, C, and D
  4. A, B, C, and D

8) Which of the following can be done by PHP code?
  1. Creation of dynamic WebPages.
  2. Add, delete, and modify data in the database.
  3. Encryption and decryption of data.
  4. PHP can send and receive cookies.

Options:

  1. A and B
  2. C and D
  3. A, B, and C
  4. A, B, C, and D

9) PHP supports AJAX?
  1. Yes
  2. No

10) Which of the following operating systems can run PHP scripts?
  1. MAC OS X
  2. Windows
  3. Linux
  4. Unix

Options:

  1. A and B
  2. C and D
  3. A, B, and C
  4. A, B, C, and D

11) Which of the following web-server is used for PHP scripts?
  1. Tomcat
  2. IIS
  3. Apache
  4. Cassini

12) Which of the following are software bundle is used for PHP and its related software's?
  1. LAMP
  2. WAMP
  3. LANP
  4. MAMP

Options:

  1. A and B
  2. C and D
  3. A, B, and D
  4. B, C, and D

13) What is 'M' stands for in LAMP?
  1. Markup
  2. MySQL
  3. Most
  4. Microsoft

14) What the full form of 'P' can be in the WAMP?
  1. PHP
  2. Python
  3. Perl
  4. All of the above

15) Can we place a PHP script anywhere in the ".php" file?
  1. Yes
  2. No

16) Which of the following functions are used to print text on the webpage?
  1. print
  2. echo
  3. disp
  4. disptext

Options:

  1. Only A
  2. Only B
  3. A and B
  4. C and D

17) What is the correct output of the given code snippets in PHP?
<?php

    $NUM1=5;
    $NUM2=10;
    
    
    $Sum =$NUM1 + $NUM2;
    
    print "Sum is: "+$Sum;
    
?>
  1. Sum is: 15
  2. Print '15' with a warning
  3. Syntax error
  4. None of the above

18) What is the correct output of the given code snippets in PHP?
<?php

    $NUM1=5;
    $NUM2=10;
    
    
    $Sum =$NUM1 + $NUM2;
    
    print 'Sum is: '.$Sum;
    
?>
  1. Sum is: 15
  2. Print '15' with a warning
  3. Syntax error
  4. None of the above

19) PHP is a case sensitive language for inbuilt functions?
  1. Yes
  2. No

20) What is the correct output of the given code snippets in PHP?
<?php
    echo '<b>'.'Hello World'.'</b>';
?>
  1. Print "<b>Hello World</b>" on the webpage.
  2. Print "Hello World" in bold style on the webpage.
  3. Print "Hello World" without bold style on the webpage.
  4. None of the above

21) Which of the following ways are used to comment a single line in PHP?
  1. # commented line
  2. // commented line
  3. 'commented line
  4. : commented line

Options:

  1. Only A
  2. Only B
  3. A and B
  4. C and D

22) What is the correct output of the given code snippets in PHP?
<?php

    $NUM1=5;
    $NUM2=10;
    
    
    $Sum =$NUM1 /*5+10=15*/+ $NUM2;
    
    print "Sum is: ".$Sum;
    
?>
  1. Sum is: 15
  2. Print "15" with warning
  3. Syntax error
  4. None of the above

23) What is the correct output of the given code snippets in PHP?
<?php

    int $NUM1=5;
    int $NUM2=10;
    
    
    $Sum =$NUM1 /*5+10=15*/+ $NUM2;
    
    print "Sum is: ".$Sum;
    
?>
  1. Sum is: 15
  2. Print "15" with warning
  3. Syntax error
  4. None of the above

24) What is the correct output of the given code snippets in PHP?
<?php

    $NUM1=5;
    $NUM2=10;
    
    
    $Sum =$NUM1 + $NUM2;
    
    print "Sum is: ".$sum;
    
?>
  1. Sum is: 15
  2. Syntax error
  3. Sum is:
  4. None of the above

25) What is the correct output of the given code snippets in PHP?
<?php

    $NUM1=5;
    $NUM2=10;
    
    
    $Sum =$NUM1 + $NUM2;
    
    print "Sum is: $Sum";
    
?>
  1. Sum is: 15
  2. Syntax error
  3. Sum is:
  4. None of the above

26) Is it true the "echo" statement has no return value while "print" has return value?
  1. Yes
  2. No






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.