Hi in this post too we’re going to discuss Elroi PHP Fresher Interview Questions with Answers[Elroi PHP Fresher Interview Questions with Answers–PART 1,Elroi PHP Fresher Interview Questions with Answers–PART 2]. Let us explore the questions briefly;

Elroi PHP Fresher Interview Questions with Answers–PART 3

13.What is the syntax for execution of sql in php?

connection-Is required to specify the MySQL connection to use.
query-Is required to specify the query string.
resultmode-Is optional.A constant.Either:
=>MYSQLI_USE_RESULT (Use this to retrieve large amount of data)
=>MYSQLI_STORE_RESULT (This is default)

14.What are the types of error in php?

Basically there are four types of errors in PHP, which are as follows:
A.Parse Errors (syntax errors):
The parse error occurs if there is a syntax mistake in the script.Common reason of syntax errors are:
=>Unclosed quotes
=>Missing or Extra parentheses
=>Unclosed braces
=>Missing semicolon

B.Fatal Errors:
=>If you are trying to access the undefined functions, then the output is a fatal error.Fatal errors stop the execution of the script.
=>Fatal errors are caused when PHP understands what you’ve written, however what you’re asking it to do can’t be done.

C.Warning Errors:
Warning errors will not stop execution of the script.The main reason for warning errors are to include a missing file or using the incorrect number of parameters in a function.

D.Notice Errors:
Notice that an error is the same as a warning error that execution of the script does not stop. Notice that the error occurs when you try to access the undefined variable, then produce a notice error.

15. What is in junction?

Directory junctions are an NTFS-specific feature. There are no directory junctions in Linux. There are directory-binding mounts (look for “The bind mounts”), which provide similar functionality, however they require root access.

16. What are the webservers you know?

1]The Apache HTTP Server, generally called Apache is a free and open-source cross-platform web server, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation.

2]Nginx can be deployed to serve dynamic HTTP content on the network using FastCGI, SCGI handlers for scripts, WSGI application servers or Phusion Passenger modules, and it can serve as a software load balancer.Nginx default configuration file is nginx.conf.

3]Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser.Node.js can be combined with a browser, a database that supports JSON data and JSON for a unified JavaScript development stack. With the adaptation of what were essentially server-side development patterns such as MVC, MVP, MVVM, etc., Node.js allows the reuse of the same model and service interface between client-side and server-side.

17. What are the types of loops in PHP?

PHP supports following four loop types.
A.for − loops through a block of code a specified number of times.
for (init counter; test counter; increment counter) {
code to be executed;
B.while − loops through a block of code if and as long as a specified condition is true.
while (condition is true) {
code to be executed;
C.do…while − loops through a block of code once, and then repeats the loop as long as a special condition is true.
do {
code to be executed;
} while (condition is true);do_while_loop
D.foreach − loops through a block of code for each element in an array.
foreach ($array as $value) {
code to be executed;

18. What is the function of var_dump?

The var_dump() function is used to dump information about a variable. This function displays structured information such as type and value of the given variable. Arrays and objects are explored recursively with values indented to show structure. This function is also effective with expressions.
void var_dump ($expsn)
The function takes a single argument $expsn that may be one single variable or an expression containing several space separated variables of any type.
This function has no return type.

To be continued…