Bonus Assignment

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Bonus Assignment:-

Student name:- Gurnimrat Singh


Id:- w0813149
Course Name:- PHP
Section number:- C4C
1. What does PHP stands for ?
= PHP hypertext processor.

2. What are three things we need in order to run the file for PHP?
=We need notepad++, Web browser and a Server.

3. Is PHP free and open source?


= Yes, it is free.

4. What scripting language is PHP?


= Server-side scripting language.

5. What is the basic syntax of PHP?


=The basic syntax of php is:-<html>
6. What is the file extension for PHP?
=.php is the file extension.

7. Write a PHP code and display the following result – Hello Everyone! – use notepad++
=code

Output:

8.What statement did you use to display “ Hello everyone! “?


= The statement is echo “ Hello everyone!”;.
9.What is the prefix we use for variables?
= $ sign is used as prefix for variables.

10. What will be the output of following

$author= “Neymar”;

$msg=”man of the match,hurrey!”;


Echo $author . “ is the ”.$msg;
?>

11.What is wrong with the following variables?


A) $first name
= there is no space between words.

B) $99firstname
=we cannot write numbers in starting.
C) $First%name
=special characters are not allowed.

12. Name different types of data types?


= $x = “hello”; ---- String
$x = 17; -----integer
$x = 74.387;- -------float
$x = true; ------boolean
$x =array(“html”, “css”, “js”); -----array
$x = new myclass(); ---------object
$x = null; --------null

13. What is var_dump used for?


=This will show you variable and data type.

14. Write the syntax to display the data type.

15. Create PHP code and introduce different data types.


Attach the snapshot of array, string and integer.
Use Notepad++
=integer

=Array
=string

You might also like