26-08-2017, 12:35 PM
chances are that questions are asked:
1. What is PHP?
Ans: PHP is a server-side scripting language commonly used for web applications. PHP has many frames and cms to create websites. Even a non-technical person can cretae sites using their CMS.WordPress, osCommerce are the famus CMS of php.It is also an object-oriented programming language like java, C-sharp etc.It is very eazy to learn
2. What is the use of "echo" in php?
Ans:It is used to print a data in the web page, Example: <? Php echo 'Car Insurance'; ?>, The following code prints the text on the webpage
3. How to include a file in a php page?
Ans:We can include a file using the "include ()" or "require ()" function with the file path as its parameter.
4. What is the difference between include and require?
Ans:If the file is not found by require (), it will cause a fatal error and stop the execution of the script. If the file is not found by include (), a warning will be issued, but execution will continue.
5. require_once (), require (), include () What is the difference between them?
Ans:Require () includes and evaluates a specific file, whereas require_once () does so only if it has not been previously included (on the same page). Therefore, require_once () is recommended to use when you want to include a file in which it has many functions, for example. This way, make sure you do not include the file more times and you will not get the "function re-declared" error.
6. Differences between GET and POST methods?
Ans:We can send 1024 bytes using the GET method, but the POST method can transfer large amount of data and POST is the safe method than the GET method.
7. How to declare an array in php?
Ans:For example: var $ arr = array ('apple', 'grape', 'lemon');
8. What is the use of 'print' in php?
Ans:This is not really a real function, it is a construct of language. So you can use without parentheses with your list of arguments.
Example of printing ('PHP Interview questions');
Print 'Job Interview');
9. What is the use of the in_array () function in php?
Ans:In_array is used to check if a value exists in an array
10. What is the use of the count () function in php?
Ans:Count () is used to count all elements of an array, or something in an object
11. What is the difference between include and require?
Ans:It's how they handle faults. If the file is not found by require (), it will cause a fatal error and stop the execution of the script. If the file is not found by include (), a warning will be issued, but execution will continue.
12. What is the difference between Session and Cookie?
Ans:The main difference between sessions and cookies is that sessions are stored on the server and cookies are stored on the user's computers in the text file format. Cookies can not keep several variables while the session can contain several variables. We can establish the expiration of a cookie. The session remains active only while the browser is open. Users do not have access to the data stored in Session, since it is stored on the server. The session is primarily used for the purpose of login / logout while cookies are used for tracking user activity
13. How to set cookies in PHP?
Ans:Setcookie ("sample", "ram", time () + 3600);
14. How to retrieve a cookie value?
Ans:For example: echo $ _COOKIE ["user"];
15. How to create a session? How to establish a value in the session? How to delete data from a session?
Ans:Create session: session_start ();
Set value in session: $ _SESSION ['USER_ID'] = 1;
Delete data from a session: unset ($ _ SESSION ['USER_ID'];
16. What types of loops are there in php?
Ans:For, while, does while and foreach (NB: You must learn its use)
17. How to create a mysql connection?
Ans:Mysql_connect (server_name, username, password);
1. What is PHP?
Ans: PHP is a server-side scripting language commonly used for web applications. PHP has many frames and cms to create websites. Even a non-technical person can cretae sites using their CMS.WordPress, osCommerce are the famus CMS of php.It is also an object-oriented programming language like java, C-sharp etc.It is very eazy to learn
2. What is the use of "echo" in php?
Ans:It is used to print a data in the web page, Example: <? Php echo 'Car Insurance'; ?>, The following code prints the text on the webpage
3. How to include a file in a php page?
Ans:We can include a file using the "include ()" or "require ()" function with the file path as its parameter.
4. What is the difference between include and require?
Ans:If the file is not found by require (), it will cause a fatal error and stop the execution of the script. If the file is not found by include (), a warning will be issued, but execution will continue.
5. require_once (), require (), include () What is the difference between them?
Ans:Require () includes and evaluates a specific file, whereas require_once () does so only if it has not been previously included (on the same page). Therefore, require_once () is recommended to use when you want to include a file in which it has many functions, for example. This way, make sure you do not include the file more times and you will not get the "function re-declared" error.
6. Differences between GET and POST methods?
Ans:We can send 1024 bytes using the GET method, but the POST method can transfer large amount of data and POST is the safe method than the GET method.
7. How to declare an array in php?
Ans:For example: var $ arr = array ('apple', 'grape', 'lemon');
8. What is the use of 'print' in php?
Ans:This is not really a real function, it is a construct of language. So you can use without parentheses with your list of arguments.
Example of printing ('PHP Interview questions');
Print 'Job Interview');
9. What is the use of the in_array () function in php?
Ans:In_array is used to check if a value exists in an array
10. What is the use of the count () function in php?
Ans:Count () is used to count all elements of an array, or something in an object
11. What is the difference between include and require?
Ans:It's how they handle faults. If the file is not found by require (), it will cause a fatal error and stop the execution of the script. If the file is not found by include (), a warning will be issued, but execution will continue.
12. What is the difference between Session and Cookie?
Ans:The main difference between sessions and cookies is that sessions are stored on the server and cookies are stored on the user's computers in the text file format. Cookies can not keep several variables while the session can contain several variables. We can establish the expiration of a cookie. The session remains active only while the browser is open. Users do not have access to the data stored in Session, since it is stored on the server. The session is primarily used for the purpose of login / logout while cookies are used for tracking user activity
13. How to set cookies in PHP?
Ans:Setcookie ("sample", "ram", time () + 3600);
14. How to retrieve a cookie value?
Ans:For example: echo $ _COOKIE ["user"];
15. How to create a session? How to establish a value in the session? How to delete data from a session?
Ans:Create session: session_start ();
Set value in session: $ _SESSION ['USER_ID'] = 1;
Delete data from a session: unset ($ _ SESSION ['USER_ID'];
16. What types of loops are there in php?
Ans:For, while, does while and foreach (NB: You must learn its use)
17. How to create a mysql connection?
Ans:Mysql_connect (server_name, username, password);