Essential Interview Questions for PHP Developers


Posted February 6, 2020 by outsources

outsource nodejs developer, outsource, outsource your project, outsource ruby developer, outsource jobs.

 
PHP is a popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.
If you’re looking for PHP Interview Questions for freshers, you are at right place. Plenty of opportunities from many reputed companies. According to research PHP has a market share of about 64.8%. Brush, up your skills and rock your career in PHP Development.
1. What is PHP.
ans. PHP is a server side scripting language commonly used for web applications. PHP has many frameworks and cms for creating websites.
2.How to include a file to a php page?
ans. We can include a file using “include() ” or “require()” function with file path as its parameter.
3. What’s the difference between include and require?
ans. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
4.Differences between GET and POST methods ?
ans. We can send 1024 bytes using GET method but POST method can transfer large amount of data and POST is the secure method than GET method .
5.How to declare an array in php?
ans. Eg : var $arr = array(‘apple’, ‘grape’, ‘lemon’.
6.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 hold multiple variables,But Session can hold multiple variables.We can set expiry for a cookie,The session only remains active as long as the browser is open.Users do not have access to the data you stored in Session,Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity tracking.
7. How to create a session? How to set a value in session ? How to Remove data from a session?
ans. Create session : session_start();
Set value into session : $_SESSION[‘USER_ID’]=1;
Remove data from a session : unset($_SESSION[‘USER_ID’];
8.What types of loops exist in php?
ans. for,while,do while and foreach (NB: You should learn its usage).
9.How to execute an sql query? How to fetch its result ?
ans. $my_qry = mysql_query(“SELECT * FROM `users` WHERE `u_id`=’1′; “);
$result = mysql_fetch_array($my_qry);
echo $result[‘First_name’];
10.Define Object-Oriented Methodology
ans. Object orientation is a software/Web development methodology that is based on the modeling a real world system.An object is the core concept involved in the object orientation. An object is the copy of the real world entity. An object oriented model is a collection of objects and its inter-relationships.
For your further reading here is the list of best PHP books, Wish you best of luck.
For more details on our products and services, please feel free to visit us at: outsource nodejs developer, outsource, outsource your project, outsource ruby developer, outsource jobs.
-- END ---
Share Facebook Twitter
Print Friendly and PDF DisclaimerReport Abuse
Contact Email [email protected]
Issued By outsource
Country United States
Categories Business
Last Updated February 6, 2020