PHP Interview
Question
By: Coding Tag
ABOUT US
About Coding Tag
Coding Tag is the E-learning website covering all tutorials of
technical and nontechnical tutorials including advanced
programming , web Development,current affairs and Technical
interviews....
In Coding tag , It’s the outstanding reference platform for
Interview questions as well on :-
HTML CSS PHP SQL C C++ OOPS Ajax JS Python etc...
In this presentation you will learn about latest frequently asked Interview questions related to PHP.
More info related to PHP Interview questions
What is the purpose of constant() function?
According to the name, this function return the value of the constant. but you don’t know its
name, i.e. It is stored in a variable or returned by a function.
<?php
define("MINSIZE", 50);
echo MINSIZE;
echo constant("MINSIZE"); // same as the previous statement
?>
What is NULL?
NULL is a one special type with one and only value stored in it is : NULL.It is a special
constant that is capitalized by convention, but actually it is case insensitive .
$my_var = null;
Variable assigned NULL has the following properties:-
▰ It evaluates to FALSE in a Boolean context.
▰ It returns FALSE when tested with IsSet() function.
Explain the syntax for ‘foreach’ loop.
The foreach loop statement is used to loop in arrays values ,for
each value of the current array element is assigned to $value and
the array pointer move one by one .So after that next element is
allowed to process.
foreach (array as value)
{
code to be executed;
}
How to concatenate to strings?
To concatenate two string variables together, use the dot (.) operator.
<?php
$string1="Hello World";
$string2="444";
echo $string1 . " " . $string2;
?>
This will produce following result −
Hello World 444
7
THANKS!
Any questions?
You can find me at
CodingTag.com

PHP interview questions || Coding Tag

  • 1.
  • 2.
    ABOUT US About CodingTag Coding Tag is the E-learning website covering all tutorials of technical and nontechnical tutorials including advanced programming , web Development,current affairs and Technical interviews.... In Coding tag , It’s the outstanding reference platform for Interview questions as well on :- HTML CSS PHP SQL C C++ OOPS Ajax JS Python etc... In this presentation you will learn about latest frequently asked Interview questions related to PHP. More info related to PHP Interview questions
  • 3.
    What is thepurpose of constant() function? According to the name, this function return the value of the constant. but you don’t know its name, i.e. It is stored in a variable or returned by a function. <?php define("MINSIZE", 50); echo MINSIZE; echo constant("MINSIZE"); // same as the previous statement ?>
  • 4.
    What is NULL? NULLis a one special type with one and only value stored in it is : NULL.It is a special constant that is capitalized by convention, but actually it is case insensitive . $my_var = null; Variable assigned NULL has the following properties:- ▰ It evaluates to FALSE in a Boolean context. ▰ It returns FALSE when tested with IsSet() function.
  • 5.
    Explain the syntaxfor ‘foreach’ loop. The foreach loop statement is used to loop in arrays values ,for each value of the current array element is assigned to $value and the array pointer move one by one .So after that next element is allowed to process. foreach (array as value) { code to be executed; }
  • 6.
    How to concatenateto strings? To concatenate two string variables together, use the dot (.) operator. <?php $string1="Hello World"; $string2="444"; echo $string1 . " " . $string2; ?> This will produce following result − Hello World 444
  • 7.
    7 THANKS! Any questions? You canfind me at CodingTag.com