• Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Have any question?

(+91) 98222 16647
info@simplycoding.in
RegisterLogin
Simply Coding
  • Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Server Side Scripting

Server Side Scripting (PHP): Question Bank

  • Categories Server Side Scripting

PHP is a widely-used open source general-purpose scripting language. It is especially suited for web development and can be embedded into HTML. This post contains various questions in the form of true/false statements, MCQs and fill in the blanks on the topic of Server Side Scripting.

State whether the following statements are true or false.

  1. PHP is a widely-used open source general-purpose scripting language.

Ans. True

  1. PHP can be embedded into HTML.

Ans. True

  1. PHP runs on only Linux and windows.

Ans. False

  1. PHP hides the code from the user

Ans. True

  1. There is a need for compilation for PHP code.

Ans. False

  1. PHP supports a wide range of Databases.

Ans. True

  1. The server-side environment that runs a scripting language is termed web server.

Ans. True.

  1. PHP mainly focuses on client-side scripting.

Ans. False

  1. PHP is slower than JSP and ASP scripting language.

Ans. False

  1. PHP is paid scripting language.

Ans. False

  1. In PHP ____ is used to identify user or it’s machine.

Ans. Cookie

  1. In PHP, when the browser requests server page, ___ are sent along with the request.

Ans. Cookies

  1. A PHP ___ is used to store user information on server to track user activates.

Ans. Session

  1. PHP session helps ______ to maintain user information on all the PAGES.

Ans. web applications

  1. PHP is a case sensitive scripting language.

Ans. True

  1. In PHP, all keywords Classes, Functions, and User-defined functions are case-sensitive.

Ans. False

  1. PHP has some predefined error reporting constants to generate a warning or error notice.

Ans. True

  1. In PHP data types are not set in a strict sense.

Ans. True

  1. We can add a string to an integer without causing an error.

Ans. True

  1. $conn -> null is to close the database connectivity object.

Ans. True

  1. Cookies in PHP create track activities in the server computer.

Ans. False

  1. PHP can be used both to create and retrieve cookie values.

Ans. True

  1. Keywords, function and class names in PHP are case insensitive.

Ans. True

  1. The echo keyword is case sensitive.

Ans. False

  1. <?php and ?> special processing instruction allow users to move INTO and OUT of “PHP mode.”

Ans. True

  1. A PHP script cannot be placed anywhere in the HTML document.

Ans. False

  1. A Variable name in PHP must start with a letter or the underscore character.

Ans. True

  1. A Variable name can start with a number.

Ans. False

  1. Variable names are case-sensitive.

Ans. True.

  1. A variable declared within a function has a Global Scope.

Ans. False

  1. We can access a Global Variable $c from within a function using “GLOBAL” keyword before the variables.

Ans. True

  1. In PHP when a function is executed, then all of its Variables are deleted.

Ans. True

  1. Variables can store data of different types.

Ans. True

  1. Using var_dump() method in PHP we can check the data-type of variable.

Ans. True

  1. var_dump() method in PHP gives the same output for each type of data type.

Ans. False

  1. PHP method var_dump() gives actual digit for ‘Boolean’ data type.

Ans. False

  1. Comments are ignored during execution.

Ans. True

  1. The ‘If statement’ in PHP executes a piece of code conditionally.

Ans. True

  1. PHP function str_replace() replaces all characters with some other characters in a string.

Ans. False

  1. The substr() function returns a part of strig.

Ans. True

  1. PHP built-in functions can be called directly to perform a specific task.

Ans. True

  1. An array is a variable that can hold more than one value at a time.

Ans. True

  1. The index can be assigned manually.

Ans. False

  1. In associative array, instead of index location, we can refer values with the help of keys.

Ans. True

  1. PHP can handle multiple levels of single dimensional array.

Ans. False

  1. GET has no limits on the amount of information to send.

Ans. False

  1. PHP GET method can be best for sending passwords online.

Ans. False

  1. Information sent from a Form with the POST method is invisible to everyone.

Ans. True

  1. POST Method in PHP does not make it possible to bookmark the page.

Ans. True

  1. ‘->’ is used to execute SQL statement.

Ans. True

  1. PHP POST Method helps us to know if the button is clicked or not.

Ans. False

  1. In PHP try/catch block the code to handle the error can be place in catch{ } block.

Ans. True

  1. StrLength() function returns the length of a string.

Ans. False

  1. Strrev() function reverses a string.

Ans. True

  1. Strpos() function returns a string

Ans. True

  1. trim() function adds white space and other pre-defined characters from both sides of a string

Ans. True

  1. Multidimensional arrays are the ones with named keys.

Ans. False

  1. The len() function is used to return the length of an array.

Ans. False

  1. We cannot create our own functions in PHP.

Ans. False

Fill in the following blanks:

  1. PHP is especially suited for ____ results.

Ans. web development

  1. The server side environment running a scripting language is called _______

Ans. web server

  1. ____ is compatible with almost all servers used today.

Ans. PHP           

  1. PHP is easy to learn and runs efficiently on the ___ side.

Ans. Server

  1. PHP files have ___ extension.

Ans. .php        

  1. _____ keyword displays text on a web page.

Ans. echo

  1. ______ is a symbol or name that stands for a specific value.

Ans. variable

  1. A variable stands with the _____ sign followed by variable name.

Ans. $

  1. User’s request to generate _____ pages is fulfilled by running a script directly on the web server.

Ans. dynamic HTML

  1. PHP, JAVA AND JSP and Python examples of ______ programming languages.

Ans. server-side

  1. _____ scripting is used to collect form data, generate dynamic page content, or send and receive cookies.

Ans. Server-side

  1. PHP provides access logging by creating the ____ of recent accesses for the user.

Ans. summary

  1. PHP is most popular and frequently used worldwide ____ scripting language.

Ans. server-side

  1. PHP is platform ____ scripting language.

Ans. Independent

  1. In PHP try/catch block, the part of code which may be erroneous can be put in ___ block.

Ans. try{ }

  1. In PHP PDO exception class is used to throw errors due to____.

Ans. Database connectivity

  1. The PHP code is usually enclosed in special processing instruction ____.

Ans. 

  1. The ____ names in PHP are case sensitive.

Ans. variable

  1. ____ is a symbol or name that stands for a value.

Ans. Variable

  1. ____, _____ and ____ are three different variable scopes in PHP.

Ans. Local, global, static

  1. _____ variable can only be accessed outside a function.

Ans. Global

  1. ____ PHP Variable can only be accessed within that function.

Ans. Local Scope

  1. PHP method var_dump() gives the length of string for ____ data type.

Ans. String

  1. ____ are the statements in PHP code, which are not visible in the output of the program.

Ans. Comments

  1. The ‘If statement’ in PHP allows programmer to make decisions based on one or more____.

Ans. Conditions

  1. ___ are used to execute the same block of code repeatedly as long as a certain condition is satisfied.

Ans. Loops

  1. ____ loop only works for array in PHP.

Ans. Foreach

  1. The PHP predefined function ____ returns the length of a string.

Ans. strlen()

  1. The PHP predefined function str_word_count() is used to count the number of words in____.

Ans. a string

  1. A ____ is a series of characters.

Ans. String             

  1. _____ is a block of statements that can be used repeatedly in a program.

Ans. Function

  1. PHP Method GET may be used for sending ____ data.

Ans. non- sensitive

  1. ___ method in PHP supports multi-part binary input while uploading files to server.

Ans. POST

  1. ____ method in PHP is used to check whether variable has value or not.

Ans. isset()

  1. ___ exceptions are used to handle errors in PHP.

Ans. PDO

  1. Anything you do with PDO should be wrapped in a ___ block.

Ans. try/catch

  1. An ___ stores multiple values in one single variable.

Ans. Array

  1. ____, ____ and ____ arrays are the types of array.

Ans. Indexed, Associative, Multi-Dimensional

  1. The count() function in PHP is used to return the ___ of an array.

Ans. Length

  1. A ____ array is an array containing one or more arrays.

Ans. Multidimensional

  1. _____ function converts a string to lowercase

Ans. strtolower()

  1. ______ converts the first character of each word in a string to uppercase.

Ans. ucwords()

  1. Arguments are specified after the ____ name, inside the parentheses.

Ans. function

  1. When browsers request server page, ____ are sent along with the request.

Ans. cookies

Multiple Choice Questions:

  1. A ____ is a computer system that serves as a central repository of data and programs.
    1. Client
    2. Server
    3. Admin
    4. User

Ans. 2

  1. PHP supports variable usage without declaring its____.
    1. name
    2. data type
    3. function
    4. none of above

Ans. 2

  1. A PHP file normally contains HTML tags, and some ____scripting code.
    1. Java
    2. Ruby
    3. Python
    4. PHP

Ans. 4

  1.   <?php and ?> allows to embed ___code within PHP code.
    1. Java
    2. HTML
    3. PHP
    4. None of above

Ans. 2

  1. All the PHP files have extension ____.
    1. ‘.txt’
    2. ‘.java’
    3. ‘.php’
    4. ‘.html’

Ans. 3

  1. Variables in PHP are used for storing____.
    1. Numeric values
    2. Characters
    3. Memory addresses
    4. All of above

Ans. 4

  1. In PHP, a variable starts with the ____ sign.
    1. @ (At Symbol )
    2. % (Percent)
    3. $ (Dollar)
    4. ? (question mark)

Ans. 3

  1. A variable declared outside a function has a ___ scope.
    1. Local
    2. Global
    3. Static
    4. None of above

Ans. 2

  1. var_dump() method in PHP gives true/false for ___ data type.
    1. String
    2. Integer
    3. Boolean
    4. Float

Ans. 3

  1. A Single-line comment is possible if we add ___ before a statement in PHP.
    1. //
    2. #
    3. Both of above
    4. None of above

Ans. 3

  1. A cookie is a small text file that the ___ sends on the user’s computer.
    1. Client
    2. Server
    3. Database
    4. Internet

Ans. 2

  1. _____ helps web applications to maintain user information on all pages.
    1. Session
    2. Presentation
    3. Cookie
    4. None of above

    Ans. 1

  2. PHP function ____ converts a string to lowercase.
    1. strrev()
    2. substr()
    3. strtolower()
    4. None of above

Ans. 3

  1. PHP function substr_count() counts the number of times ___ occurs in a string.
    1. Substring
    2. Word
    3. Blank Space
    4. Number

Ans. 1

  1. PHP function ucwords() is used to convert the first character of each word in a string to____.
    1. Sentence case
    2. Uppercase
    3. Lowercase
    4. All of above

Ans. 2

  1. ____ arrays are arrays that use named keys instead of index to identify record/value.
    1. Indexed
    2. Associative
    3. Multi-Dimensional
    4. None of above

Ans. 2

  1. PHP ___ method also has limits on the amount of information to send.
    1. GET
    2. POST
    3. Both of above
    4. None of above

Ans. 1

  1. A multiline comment can be added in PHP via: 
    1. //
    2. #
    3. $
    4. /* and */

    Ans. 4

  2. _____ are used to execute the same block of code repeatedly as long as a certain condition is satisfied.
    1. Variable
    2. Loops
    3. Object
    4. None of above

Ans. 2

  1. _____ method is used to send form data.
    1. HTTP POST
    2. FTP POST
    3. STP POST
    4. None of above

Ans. 1

  1. Index in arrays always starts with ___.
    1. 1(one)
    2. 0(zero)
    3. -1(minus one)
    4. Any number

Ans. 2

 

  • Share:
author avatar
Simply Coding

Previous post

Search Engine Optimization: Notes
September 28, 2020

Next post

Server Side Scripting (PHP): Notes
September 29, 2020

You may also like

php notes
Server Side Scripting (PHP): Notes
29 September, 2020

Leave A Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Uncategorized
  • Programs
    • Python
    • Java
  • Problems
    • Python
    • Java
    • Web Development
      • Internet
    • Emerging Technologies
  • Notes
    • General
    • QBasic
    • MS Access
    • Web Development
      • XML
      • HTML
      • JavaScript
      • Internet
    • Database
    • Logo Programming
    • Scratch
    • Emerging Trends
      • Artificial Intelligence
      • Internet of Things
      • Cloud Computing
      • Machine Learning
    • Computer Fundamentals
      • Computer Networks
      • E-Services
      • Computer Hardware
    • Python
    • Java
  • School
    • ICSE
      • Computers Class 9
        • Java Introduction
        • Tokens & Data Types
        • Java Operators
        • Math Library
        • if & switch
        • For & While
        • Nested loops
      • Computer Class 10
        • Sample Papers
        • OOPS concepts
        • Functions in Java
        • Constructors
        • Arrays in Java
        • Strings in Java
    • SSC
      • IT Class 11
        • IT Basics
        • DBMS
        • Web Designing
        • Cyber Laws
      • IT Class 12
        • Web Designing
        • SEO
        • Advanced JavaScript
        • Emerging Tech
        • Server Side Scripting
        • E-Com & E-Gov
      • Computer Science 11
      • Computer Science 12
    • CBSE
      • Computer 9
        • Basics of IT
        • Cyber Safety
        • Scratch
        • Python
      • Computer 10
        • Sample Papers
        • Networking
        • HTML
        • Cyber Ethics
        • Scratch
        • Python
      • Computer Science 11
        • Computer Systems
        • Python 11
          • Python Basics
          • Python Tokens
          • Python Operators
          • Python if-else
          • Python loops
          • Python Strings
          • Python List
          • Python Tuple
          • Python Dictionary
          • Python Modules
        • Data Management
      • Computer Science 12
        • Sample Papers
        • Python 12
          • Python Functions
          • Python File Handling
          • Python Libraries
          • Python Recursion
          • Data Structures
        • Computer Networks
        • Data Management
    • ISC
      • Computer Science 11
        • Introduction to Java
        • Values & Data Types
        • Operators
        • if & switch
        • Iterative Statements
        • Functions
        • Arrays
        • String
        • Data Structures
        • Cyber Ethics
      • Computer Science 12
        • Sample Papers
        • Boolean Algebra
        • OOPS
        • Wrapper Classes
        • Functions
        • Arrays
        • String
Simply Coding Computer Courses for School                Privacy Policy     Terms of Use     Contact Us

© 2021 Simply Coding

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now