php exam
php exam
Part I: -Say True or False (2% Each) Name ____________________________ Program _______________ ID No_ __________
1. Dynamic functionality means could automatically and continually display user posts, Part I: -Say True or False (2% Each)
relevant news, and product updates.
2. A scripting language is a programming language that executes tasks within a special run- 1. Dynamic functionality means could automatically and continually display user posts,
time environment by a compiler. relevant news, and product updates.
3. The term server-side scripting language refers to those that run off the user’s browser. 2. A scripting language is a programming language that executes tasks within a special run-
4. Operators are used to performing operations on some values. time environment by a compiler.
5. PHP code is directly embedded to HTML code. 3. The term server-side scripting language refers to those that run off the user’s browser.
6. Variables used to store values. 4. Operators are used to performing operations on some values.
7. The term client-side scripting languages run off a web server. 5. PHP code is directly embedded to HTML code.
8. PHP data types are used to hold different types of data or values. 6. Variables used to store values.
9. Control structure provide the ability to control the flow of execution in a program based on 7. The term client-side scripting languages run off a web server.
certain conditions. 8. PHP data types are used to hold different types of data or values.
10. PHP is one of the most popular scripting languages and works on the server side. 9. Control structure provide the ability to control the flow of execution in a program based on
Part II: -Chose the Best Answer from The Given Alternative (1.5% Each) certain conditions.
10. PHP is one of the most popular scripting languages and works on the server side.
1. Which one of the following not an environment for server-side scripting. Part II: -Chose the Best Answer from The Given Alternative (1.5% Each)
A. PHP B. Phyton C. Perl D. HTML
2. Which one of the following not an environment for client-side scripting. 1. Which one of the following not an environment for server-side scripting.
A. Java script B. Phyton C. CSS D. HTML A. PHP B. Phyton C. Perl D. HTML
3. PHP script can be start and end with … 2. Which one of the following not an environment for client-side scripting.
A. <php>…</php> B. <?php…?> C. ?php…..</php> D. None A. Java script B. Phyton C. CSS D. HTML
4. Which of the following is true about variable declaration in PHP. 3. PHP script can be start and end with …
A. Must start with a dollar sign C. Must start with letter or underscore A. <php>…</php> B. <?php…?> C. ?php…..</php> D. None
B. Cannot contain space D. All 4. Which of the following is true about variable declaration in PHP.
5. Which operator is used to simple mathematical operations? A. Must start with a dollar sign C. Must start with letter or underscore
A. Logical B. Comparation C. Arithmetic D. All B. Cannot contain space D. All
6. How do you write a comment in PHP? 5. Which operator is used to simple mathematical operations?
A. /* comment */ B. // comment C. # comment D. All of the above A. Logical B. Comparation C. Arithmetic D. All
7. Which of the following variables is correctly named in PHP? 6. How do you write a comment in PHP?
A. $variable Name B. $variable-name C. $var_name D. $var name A. /* comment */ B. // comment C. # comment D. All of the above
8. Which of the following is the default file extension of PHP files? 7. Which of the following variables is correctly named in PHP?
A .php B .ph C .xml D .html A. $variable Name B. $variable-name C. $var_name D. $var name
9. Which of the following web servers are required to run the PHP script? 8. Which of the following is the default file extension of PHP files?
A. Apache and PHP B. IIS C. XAMPP D. Any of the mentioned A .php B .ph C .xml D .html
10. What is PHP? a) PHP is an open-source programming language b) PHP is used to 9. Which of the following web servers are required to run the PHP script?
develop dynamic and interactive websites c) PHP is a server-side scripting language A. Apache and PHP B. IIS C. XAMPP D. Any of the mentioned
d) All 10. What is PHP? a) PHP is an open-source programming language b) PHP is used to
Part III: - Short Answer develop dynamic and interactive websites c) PHP is a server-side scripting language
d) All
1. PHP stands for ..._______________________________________ Part III: - Short Answer
2. Write a PHP code that loop from 1 to 10 with WHILE LOOP statement.
3. Write down the difference between Server side and client-side scripting. 1. PHP stands for ..._______________________________________
2. Write a PHP code that loop from 1 to 10 with WHILE LOOP statement.
3. Write down the difference between Server side and client-side scripting.