8) How can we show the output directly to the browser?
we must use the special tags <?= and ?> to show the output directly to the browser.
9) What is the main diversity between PHP 4 and PHP 5?
PHP 5 presents many additional OOP features.
10) Is multiple inheritance supported in PHP?
PHP supports only single inheritance; it means that a class can be extended from only one single class utilizing the keyword 'extended'.
11) What is a final class and a final method?
'final' is introduced in PHP5. Final class means that class cannot be extended and a final method cannot be overridden.
12) How does the objects compare in PHP?
We use the operator '==' for testing two objects are instanced from the same class and have the same attributes and equal values. We can test if two objects are referring to the same instance of the same class by the use of the identity operator '==='.
13) How can PHP and HTML interact?
It is feasible to generate HTML through PHP scripts, and it is desirable to pass part of information from HTML to PHP.
14) What type of operation is required when passing values through a form or a URL?
We need to encode and to decode them utilizing htmlspecialchars() and urlencode() when we want to pass values through a URL or form
16) What is needed to be able to utilize image function?
GD library is needed to execute image functions.
17) What is the use of the function 'imagetypes()'?
imagetypes() gives the image format and types supported by the current version of GD-PHP.
18) What are the functions to be used to get the image's properties (size, width, and height)?
The functions are getimagesize() for size, imagesx() for width and imagesy() for height.
19) How failures in execution are managed with include() and require() functions?
If the function require() cannot access the file then it ends with a fatal error. However, the include() function provide a warning, and the PHP script continues to execute.
20) What is the main difference between require_once() and require()?
require_once() and require() execute the same task except that the second function checks if the PHP script is already included or not before executing it.
(same for include_once() and include())
21) With a PHP script how can I display text?
Two methods are possible :
<!--?php echo "Method 1"; print "Method 2"; ?-->
22) By a human with PHP How can we display information of a variable and readable?
To be capable to show a human-readable result we utilize print_r().
23) How set an infinite execution time for PHP script?
The set_time_limit(0) added at the starting of a script sets to infinite the time of execution to not have the PHP error extreme execution time overreach.It is also feasible to complete this in the php.ini file.
24) What does the 'Parse error in PHP - unexpected T_variable at line x' means?
This is a PHP syntax error expressing that a mistake at the line x stops parsing and executing the program.
25) What should we do to be capable to export data into an Excel file?
The most natural and used style is to get data into a format supported by Excel. For example, it is possible to write a .csv file, to choose for example comma as a separator between fields and then to open the file with Excel.
If you want to learn more about PHP Interview Question Answer then PHP Training in Chandigarh is the best place for you.