PHP interview questions can help you to test knowledge of your programming skils in PHP

1 > What is php ?

Php stands for hypertext preprocessor.It is a Server Side Scripting Language use to make websites and Web Applications.Php is also an Object Programming Language .Various types of CMS are bulit by using php like WordPress,Drupal and Joomla.Zend Framework and Codeigniter Framework are used to bulit WebApplication using MVC(Model Controller View ) architecture.

2>How to include a file in  Programming?

To include a file in  “include() ” or “require()” or include_once ?> function with right file name as a parameter .

Ex :- <?php  include(images/abc.jpg)  ?>

3> What’s the difference between include and require?

When you declare require() function, it will cause a fatal error and stop the execution of the php script. In Second Case,if  file is not  found by include() , a warning will be issued, but execution will continue.

4>How to Declare Function in php ?

To declare a function, you  should follow following  syntax.Php function name always declared with parenthesis;

Ex :- <?php

InterviewAnswersPhp()

{

echo ‘ PHP interview questions and answers for freshers‘;

}

?>

5>Which function of php is used to check the length of string ?

To check the length of string ,We can use strlen() function by passing a string variable as a parameter.

Ex :- <?php

$str_length=”Php”;

echo strlen($str_length);

?>

6: How to declare a variable ?

In php langauge,$ is used to declare a variable

Ex :- <?php

$declare_var=”Php”;

echo strlen($str_length);

?>

7. How can we send data from HTML Form to Server ?

By using METHOD Attribute of HTML .It determines how to send form data into server by  using two method GET and POST.HTML Form takes default GET Method if we don’t specify

Ex:- <html>

<head> </head>

<form name=”php-interview” method=”POST”>

<input type =”text” />

<input type=”submit”>

</form>

</html>

8 >Why we use of isset()  function  ?

isset() is used to check variable has a value means it is set and is not NULL.

9> If we have to stop the script then which function should we use ?

To stop the script we use exit() function .

10> How can we set any php page as a home page in Web Application?

To set Any page as a home page then we should name a file as index.php

for jobs : credosystemz.com