PHP Interview Question Set 9

Categories: PHP

How can we get IP address of a client in PHP?

$_SERVER["REMOTE_ADDR"];  


 What is the meaning of a Persistent Cookie?

A persistent cookie is permanently stored in a cookie file on the browser's computer. By default, cookies are temporary and are erased if we close the browser.


What is the use of the function 'imagetypes()'?

imagetypes() gives the image format and types supported by the current version of GD-PHP.


 What are include() and require() functions?

The Include() function is used to put data of one PHP file into another PHP file. If errors occur, then the include() function produces a warning but does not stop the execution of the script, and it will continue to execute. The Require() function is also used to put data of one PHP file to another PHP file. If there are any errors, then the require() function produces a warning and a fatal error and stops the script.


What is Cookies? How to create cookies in PHP?

A cookie is used to identify a user. A cookie is a little record that the server installs on the client's Computer. Each time a similar PC asks for a page with a program, it will send the cookie as well. With PHP, you can both make and recover cookie value.


Some important points regarding Cookies:

  1. Cookies maintain the session id generated at the back end after verifying the user's identity in encrypted form, and it must reside in the browser of the machine
  2. You can store only string values not object because you can't access any object across the website or web apps
  3. Scope: - Multiple pages.
  4. By default, cookies are temporary and transitory cookie saves in the browser only.
  5. By default, cookies are URL particular means Gmail isn't supported in Yahoo and the vice versa.


What is the Importance of Parser in PHP?

PHP parser parses the PHP developed website from the opening to the closing tag. Tags indicate that from where PHP code is being started and ended. In other words, opening and closing tags decide the scope of PHP scripting syntax of closing tag in PHP

<?php syntax of opening tag in PHP

?> syntax of closing tag in PHP


How can we create a database using PHP and MySQL?

The necessary steps to create a MySQL database using PHP are:


Establish a connection to MySQL server from your PHP script.

If the connection is successful, write a SQL query to create a database and store it in a string variable.

Execute the query.




Top Blogs
PHP freshers Interview Questions PHP Interview Questions and Answers for Freshers & Experienced Published at:- PHP Tutorial From beginner Published at:- PHP Interview Question Set 1 Published at:- PHP Interview Question Set 3 Published at:- PHP Interview Question Set 4 Published at:- PHP Interview Question Set 6 Published at:- PHP Interview Question Set 7 Published at:- PHP Interview Question Set 8 Published at:- PHP Interview Question Set 9 Published at:- Top 5 PHP Structures Published at:- 8 Motivations To pick Php web Advancement for IT Business Published at:-
R4R.co.in Team
The content on R4R is created by expert teams.