- Give the difference between $_GET and $_POST
$_GET is less secure and effective than $_ POST, $_GET has few limitations like it can send about 100 words of data at a time, whereas $_POST does not have such kind of limitations, we can send any amount of data using this variable. $_POST is more secure than $_GET in the means of that whenever we send data from one web page to another using $_GET variable we can see the values in address bar, on the contrary $_POST does not allow any thing to be displayed in address bar of the browser.
- Explain in detail advantages of PHP
PHP is one of the most popular server side scripting languages running today. It is used for creating dynamic webpages that interact with the user offering customized information. PHP offers many advantages; it is fast, stable, secure, easy to use and open source (free).
- Explain PHP variables and also explain why PHP is a loosely typed language?
Variables are used for storing values, like text strings, numbers or arrays. When a variable is declared, it can be used over and over again in your script. All variables in PHP start with a $ sign symbol. The correct way of declaring a variable in PHP: $var_name = value;
In the example above, you see that you do not have to tell PHP which data type the variable is.
PHP automatically converts the variable to the correct data type, depending on its value.
In a strongly typed programming language, you have to declare (define) the type and name of the variable before using it.
- Give syntax of date() function.
Syntax
date(format,timestamp)
- Give syntax of mktime() function
Syntax
mktime(hour,minute,second,month,day,year,is_dst)
- Write the Inbuilt function that reverses the string.
strrev(string)
- Write the Inbuilt Function that converts the string to Uppercase.
strtoupper(string)
- When we can use $REQUEST variable?
The PHP built-in $_REQUEST function contains the contents of both $_GET, $_POST, and $_COOKIE.
The $_REQUEST function can be used to collect form data sent with both the GET and POST methods.
- All variables in PHP starts with a ________ sign symbol. Ans. $
- _________ is used to print text in php page. - Echo
- PHP is server side scripting language because.........(complete the statement)
- What is an array ? List the types of array.
- Numeric array - An array with a numeric index
- Associative array - An array where each ID key is associated with a value
- Multidimensional array - An array containing one or more arrays
- Explain for loop with example.
The for loop is used when you know in advance how many times the script should run.
Syntax
for (init; condition; increment){
code to be executed;
}
- Give an example of a function that returns a value.
- Major difference between include() and require() functions.
- List 3 different function used to open, close, and checking end-of particular file.
- Difference between PHP and HTML
- What is an anchor tag?
- How can we add image in HTML document?