What is full form of PHP?
Personal Home Page or Preprocessor Hypertext
Explain the difference b/w static and dynamic websites?
Static website data changes manually whereas dynamic website data changes automatically.
What are the popular Content Management Systems (CMS) in PHP?
- Wordpress
- Drupal
- Joomla
What are the popular frameworks in PHP?
- Laravel
- Codeigniter
- Cake PHP, etc
What is "echo" in PHP?
echo is used to display output.
What is "print" in PHP?
print is also used to display output.
How a variable is declared in PHP?
using $ operator, like $a=100;
What are the different loops in PHP?
- for loop
- while loop
- do while loop
- foreach loop
What does isset() function?
isset is used to check, a value set to the variable or not.
What is the array in PHP?
Collection of values is called an array.How many types of array are there in PHP?
- Indexed array
- Associative array
- Multidimensional array
What is the difference between indexed and associative array?
Indexed arrays have key in numeric like 0, 1, 2 where associative array has key as defined.
How to get the length of string?
using strlen() function.
What are the methods to submit form in PHP?
- $_POST
- $_GET
What are the ways to include file in PHP?
- include()
- require()
Explain setcookie() function in PHP?
cookie is used to identify user records or to store data in user computer.
How can you retrieve a cookie value?
using $_COOKIE super global variable.
What is a session?
session is used to store information in server.
What is $_SESSION in PHP?
$_SESSION super global variable is used to create, access session values.
What is the difference between session and cookie?
session is used to store information in a server whereas cookie is used to store user infromation in a user computer.
How to delete file in PHP?
using unlink() function.
How to upload file in PHP?
using move_uploaded_file() function
How do you connect MySQL database with PHP?
using mysqli_connect() function
How to stop the execution of PHP script?
using exit() function
Explain PHP explode() function.
This function is used to break a string into an array
What are include() and require() functions?
Both are used to include a part of code into other part and difference is that include does not return an error when file is not found where require does.