Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

PHP Interview questions and Answers For Graduates Part-1

Be First!

php1. Who is the father of PHP ?
Rasmus Lerdorf is known as the father of PHP.

2. What is the difference between $name and $$name?
$name is variable where as $$name is reference variable like $name=sonia and $$name=singh so $sonia value is singh.

3. What are the method available in form submitting?

GET and POST

4.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);
?>

5. 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.

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

<?php
session_register($ur_session_var);
?>

7. 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

8. How can we know the total number of elements of Array?

sizeof($array_var)
count($array_var)

9. How can we create a database using php?

mysql_create_db();

10. What is the functionality of the function strstr and stristr?

strstr() returns part of a given string from the first occurrence of a given substring to the end of the string.
For example:strstr(“user@example.com”,”@”) will return “@example.com”.
stristr() is idential to strstr() except that it is case insensitive.

(137)

Previous
Next

Leave a Reply