Php technical interview questions

1. United Nations agency is that the father of PHP ?

Rasmus Lerdorf is thought because the father of PHP.

2. what's the distinction between $name and $name?

$name is variable wherever as $name is reference variable like $name=sonia and $name=singh thus $sonia price is singh.

3. What area unit the tactic offered in type submitting?


4.How will we tend to get the browser properties victimization PHP?


echo $_SERVER[‘HTTP_USER_AGENT’].”\n\n”;

5. what's a Session?

A session may be a logical object created by the PHP engine to permit you to preserve knowledge across ulterior HTTP requests. Sessions area unit usually accustomed store temporary knowledge to permit multiple PHP pages to supply an entire practical dealings for an equivalent traveler.

6. however will we tend to register the variables into a session?


7. what number ways that we are able to 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 a part of the universal resource locator

8. however will we all know the overall range of parts of Array?


9. however will we tend to produce a info victimization php?


10. what's the practicality of the operate strstr and stristr?

strstr() returns a part of a given string from the primary prevalence of a given substring to the tip of the string.
For example:strstr("","@") can come "".
stristr() is idential to strstr() except that it's case insensitive.

11. What area unit cryptography functions in PHP?

CRYPT(), MD5()

12. the way to store the uploaded file to the ultimate location?

move_uploaded_file( string computer filename, string destination)

13. justify mysql_error().

The mysql_error() message can tell North American country what was wrong with our question, the same as the message we might receive at the MySQL console.

14. what's Constructors and Destructors?

CONSTRUCTOR : PHP permits developers to declare creator ways for categories. categories that have a creator methodology decision this methodology on every newly-created object, thus it's appropriate for any low-level formatting that the item might have before it's used.
DESTRUCTORS : PHP five introduces a destructor idea the same as that of different object-oriented languages, like C++. The destructor methodology are going to be known as as before long as all references to a specific object area unit removed or once the item is expressly destroyed or in any order in closure sequence.

15. justify the visibility of the property or methodology.

The visibility of a property or methodology should be outlined by prefixing the declaration with the keywords public, protected or personal.
Class members declared public is accessed everyplace.
Members declared protected is accessed solely inside the category itself and by transmitted and parent categories.
Members declared as personal might solely be accessed by the category that defines the member.

16. What area unit the variations between Get and post ways.

There area unit some defference between GET and POST methodology
1. GET methodology have some limit like solely 2Kb knowledge able to tell request
But in POST methodology unlimited knowledge will we tend to send
2. after we use GET methodology requested knowledge show in universal resource locator however
Not in POST methodology thus POST methodology is sweet for send sensetive request

17. What area unit the variations between need and include?

Both embody and need accustomed embody a file however once enclosed file not found
Include send Warning wherever as need send Fatal Error

18. what's use of header() operate in php ?

The header() operate sends a raw HTTP header to a shopper.We can use herder()
function for redirection of pages. it's vital to note that header() should
be known as before any actual output is seen.

19. List out the predefined categories in PHP?


20. What sort of inheritance that PHP supports?

In PHP Associate in Nursing extended category is often addicted to one base category,that is, multiple inheritance isn't supported. categories area unit extended victimization the keyword 'extends'.

21. however will we tend to inscribe the username and arcanum victimization php?

You can inscribe a arcanum with the subsequent Mysql>SET PASSWORD=PASSWORD("Password");
We can write in code knowledge victimization base64_encode($string) and might decipher victimization base64_decode($string);

22. what's the distinction between explode and split?

Split operate splits string into array by regular expression. Explode splits a string into array by string.
For Example:explode(" and", "India and Islamic Republic of Pakistan and Srilanka");
split(" :", "India : Islamic Republic of Pakistan : Srilanka");
Both of those functions can come Associate in Nursing array that contains Asian nation, Pakistan, and Srilanka.

23. however does one outline a constant?

Constants in PHP area unit outlined victimization define() directive, like define("MYCONSTANT", 100);

24. however does one pass a variable by price in PHP?

Just like in C++, place Associate in Nursing punctuation mark before of it, like $a = &$b;

25. What will a special set of tags <?= and ?> liquidate PHP?

The output is displayed on to the browser.

26. however does one decision a creator for a parent class?


27. What’s the special that means of __sleep and __wakeup?

__sleep returns the array of all the variables than got to be saved, whereas __wakeup retrieves them.

28. what's the distinction between PHP and JavaScript?

javascript may be a shopper facet scripting language, thus javascript will build popups and different things happens on someone’s computer. whereas PHP is server facet scripting language thus it will each stuff with the server.

29. what's the distinction between the functions unlink and unset?

unlink() deletes the given file from the classification system.
unset() makes a variable indefinite.

30. what number ways that will we tend to get the worth of current session id?

session_id() returns the session id for the present session.

31. What area unit default session time and path?

default session time in PHP is 1440 seconds or twenty four minutes
Default session save path id temporary folder /tmp

32. for image work that library?

we will got to compile PHP with the GD library of image functions for this to figure. GD and PHP may additionally need different libraries, betting on that image formats you would like to figure with.

33. however will we tend to get second of the present time victimization date function?

$second = date(“s”);

34. What area unit the data formatting and Printing Strings offered in PHP?

printf()- Displays a formatted string
sprintf()-Saves a formatted string during a variable
fprintf() -Prints a formatted string to a file
number_format()-Formats numbers as strings

35. however will we discover the amount of rows during a result set victimization PHP?

$result = mysql_query($sql, $db_link);
$num_rows = mysql_num_rows($result);
echo "$num_rows rows found";

Faridabad Ford | Best Ford Showroom and Dealership in Faridabad

Welcome to Faridabad Ford, the largest & best ford showroom and dealership in Faridabad, your Biggest Ford Dealer for New and Used Car Sales, Servicing, Parts and Accessories.

Ghaziabad Ford | Best Ford Showroom and Dealership in Ghaziabad

Welcome to Ghaziabad Ford, the largest & best ford showroom and dealership in Ghaziabad, your Biggest Ford Dealer for New and Used Car Sales, Servicing, Parts and Accessories. We can help make your process of Buying, Servicing or Selling your car a lot easier.

List of Backlinks

List of Backlinks


Popular posts from this blog

How Outsourced Healthcare Services Leads to Improved Patient Experience?

BS6 compliant Ford EcoSport launched in India, price starts at Rs 8.04 lakhs

Best DoFollow profile creation sites list OCT 2019