top of page

                                                                                            Chapter-7: Introduction to PHP
A. Fill in the blanks.
1. Menu bar
2. Commands
3. Code editor window
4. Status bar
5. Operands


B. Write T for True and F for False.
1. True
2. True
3. False
4. True
5. False


C. Answer in one word.
1. Portability
2. Title bar
3. Code editor window
4. Arithmetic operators


D. Select the correct option.
1. a) Arithmetic
2. b) Relational
3. a) Web server
4. c) Sequence
5. a) $


E. Answer the following questions.


1. Easy to Learn: The syntax of PHP is similar to some of the popular programming languages. So, if you are familiar with any programming language, then it would be an added advantage.
Portable: The code written with PHP can run on any operating system. The code written in PHP can run on machines with Linux, Windows, and Mac operating systems.


2. Identifiers are used to name different components of a program such as variables, methods, objects, etc.


3. Variables are used to as storage location to hold the input values to be used later. The values once stored in the memory location can be drawn out for processing. Before you store a value in the memory you need to declare a variable.


4. The rules for naming variables are as follows:
• A variable name starts with a '$'.
• It can consist of any combination of letters, digits, and underscore.
• It can be of any length.
• Both the uppercase and lowercase letters can be used in naming a variable.
• Variable names are case-sensitive, i.e., $name and $NAME are two different variables


5. The valid and invalid variable names are as follows:

Invalid    -   Variable names cannot start with digits

Invalid  -     Variable name should start with $.

Invalid  -     Variable name cannot be  a keyword

Invalid  -     Hyphen cannot be used  in variable names


6. The GET method is used to submit the HTML form data. This data is collected by the predefined $_GET variable for processing. The information sent from an HTML form by using the GET method is visible to everyone in the browser's address bar. Hence, this method is not used to share sensitive information. On the other hand, the POST method is also used to submit the HTML form data. But the data submitted by this method is collected by the predefined super global variable $_POST instead of $_GET. In this method, the data collected is not visible to anyone.

61o-nQYlBTL._SY425_.jpg
bottom of page