Breaking News
Loading...
Monday 8 July 2013

PHP Interview Question and Answers

22:58
PHP interview question and answers | PHP interview questions | Download PHP Interview Questions | PHP Question | PHP Technical Interview Questions and Answers| PHP Questions.

1. What is PHP?
  • PHP stand for Hypertext Preprocessor.
  • PHP is a Server Side Scripting Language.
  • PHP is a Open Source Software.
  • PHP free to download and use.
  • PHP scripts are executed on server.
  • PHP supports many databases such as MYSQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.,
PHP development began in 1994 when the Danish/Greenlandic programmer Rasmus Lerdorf initially created a set of Perl scripts he called "Personal Home Page Tools" to maintain his personal homepage. Marco Tabini is the founder an publisher of PHP|architech.

2. What are the method available in form submitting?

GET and POST.

3. What are the differences between GET and POST methods in form submitting?

On the server side, the main difference between GET and POST is where the submitted is stored. The $_GET array stores data submitted by the GET method. The $_POST array stores data submitted by the POST method.

On the browser side, the difference is that data submitted by the GET method will be displayed in the browser’s address field. Data submitted by the POST method will not be displayed anywhere on the browser.

GET method is mostly used for submitting a small amount and less sensitive data.
POST method is mostly used for submitting a large amount or sensitive data.

4. How can we submit from without a submit button?

We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit(); function to submit the form.

5. How can we get the browser properties using php?

<?php
echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";
$browser = get_browser(null, true);
print_r($browser);
?>

6. What Is a Session?

A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.

7. How can we register the variables into a session?

session_register($ur_session_var);
?>

8. How do you destroy a particular or all Sessions?

session_start();
// store session data
$_SESSION['views']=1;
unset($_SESSION['views']); // If you wish to delete some session data, you can use the unset()
session_destroy(); // You can also completely destroy the session by calling the session_destroy() function. session_destroy() will reset your session and you will lose all your stored session data.
?>

9. How many ways we can pass the variable through the navigation between the pages?

Register the variable into the session
Pass the variable as a cookie
Pass the variable as part of the URL

10. What are the different functions in sorting an array?
  • asort()
  • arsort()
  • ksort()
  • krsort()
  • uksort()
  • sort()
  • natsort()
  • rsort()
<< Next 1 2 3 4 5 Previous>>


Share This :
Tags:

0 comments:

Post a Comment

 
Toggle Footer