0% found this document useful (0 votes)
17 views

Unit 1 PHP

Uploaded by

aadi.n.harale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Unit 1 PHP

Uploaded by

aadi.n.harale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PHP Programming R18CP5403

Unit 1

1.1 Introduction:
What is PHP?, Advantages of PHP : Performance, Scalability, Database
Integration, Built in libraries, Cost, Object oriented support, Portability.
1.2 PHP Basics: Structure of PHP script, Data Types, Variables, printing the values of variables, Constants,
comments
1.3 Operators —General
Operations, String operations, Numeric operations--Bitwise, comparison, Logical Operators, operator
Precedence.

1. Define PHP.
2. State the advantages of the PHP.
OR Explain the following advantages of the PHP
a. Performance
b. Scalability
c. Database Integration
d. Built-in libraries
e. Cost
f. Object oriented support
g. Portability

3. Explain the structure of PHP script.


4. List the different data types in PHP.
5. Explain the different data types (Scalar Types (predefined)--- Boolean, integer, float,
string), (Compound Types (user-defined)—array ,object), (Special Types—resource,
NULL) in PHP with example.
6. Define variable. Give example.
7. State the rules for defining the variable.
8. List and explain the methods used for printing the values of variables in PHP. Give
example (echo, print and print_r()).
9. State the difference between echo and print statements and print_r() .
10. Explain $ and $$ variables with example.
11. List three types of variable scopes
12. Explain the scope of variables in PHP (Local variable, Global variable, Static variable).
13. Explain with example Constants (Using define() function and const keyword) in PHP.
14. Explain with example comments (Single line comment and multi line comment) in PHP.
15. Explain with example Arithmetic Operators (+,-,*, /, %,**) in PHP.
16. Explain with example Assignment Operators (=, +=,-+,*=, /=, %=) in PHP.
17. Explain with example Bitwise operators (&,|, ^, ~, <<,>>) in PHP.
18. Explain with example Comparison operators (==, !=, <>, <, >,>=,<=) in PHP.
19. Explain with example Incrementing/Decrementing Operators (++, --) in PHP.
20. Explain with example Logical operators (and, or, xor, &&, ||,!) in PHP.
21. Explain with example String operators (. , .=) in PHP.
22. Explain with example Array operators (+,==,!=,===,!==,<>) in PHP.
23. Explain with example Conditional Assignment Operators (?:) in PHP.
24. Explain with example operator precedence in PHP.
25. Write a simple PHP program using any 4 data types and print the values.
26. Write a simple PHP program to print the string “Hello”.
27. Write a simple PHP program to print the string “Welcome to CWIT”.
28. Write a simple PHP program to print the addition to 2 numbers.
29. Write a simple PHP program to print the subtraction to 2 numbers.
30. Write a simple PHP program to print the multiplication to 2 numbers.
31. Write a simple PHP program to print the division to 2 numbers.
32. Write a simple PHP program to swap given two numbers.
33. Write a simple PHP program using conditional operators.
34. Write a simple PHP program using string operators.
35. Write a simple PHP program using logical operators.
36. Write a simple PHP program using incrementing and decrementing operators.
37. Write a simple PHP program using array operators.
38. Write a simple PHP program using comparison operators.
39. Write a simple PHP program using bitwise operators.
40. Write a simple PHP program using assignment operators.

You might also like