Important PHP interview questions for freshers











MOST IMPORTANT INTERVIEW QUESTIONS PHP

QUESTION. How to include a file to a php page?
Answer. We can include a file using "include() " or "require()" function with file path as its parameter.

QUESTION. What is difference between “include” and “require” in php?
Answer. The include and require statements are identical, except upon failure:

require will produce a fatal error (E_COMPILE_ERROR) and stop the script
include will only produce a warning (E_WARNING) and the script will continue

QUESTION:  What are the different errors in PHP?
Answer. There are 4 basically types of error.
Parse Error – Commonly caused due to syntax mistakes in codes e.g. missing semicolon, mismatch brackets.
Fatal Error – These are basically run time errors which are caused when you try to access what can’t be done. E.g. accessing a dead object, or trying to use a function that hasn’t been declared.
Warning Error – These occurs when u try to include a file that is not present, or delete a file that is not on the server. This will not halt the script; it will give the notice and continue with the next line of the script.
Notice Error – These errors occurs when u try to use a variable that hasn’t been declared, this will not halt the script, It will give the notice and continue with the next line of the script.

QUESTION: What is session and why do we use it?
Answer. Session is a super global variable that preserve data across subsequent pages. Session uniquely defines each user with a session ID, so it helps making customized web application where user tracking is needed.

QUESTION: What is cookie and why do we use it?
Answer. Cookie is a small piece of information stored in client browser. It is a technique used to identify a user using the information stored in their browser (if already visited that website) . Using PHP we can both set and get COOKIE.

To read all PHP interview questions click here.









Learn PHP : PHP variables

Considering you know the installation and configuration of WAMP or XAMPP, and you have setup your PHP on your local machine.

This is guidance for candidates who really want to learn PHP.

So, Start.
Before you continue you should have a basic understanding of the following:
  • HTML
  • CSS
  • JavaScript




We are starting with variable.

What is PHP variable?
Answer: Variables are "containers" for storing information.

In PHP, a variable starts with the $ sign, followed by the name of the variable:

Example

<?php
$txt = "Hello world!";
$x = 10;
$y = 20;
?>
In above example, $txt is variable, which stores value "Hello word!". 
$x and $y also variables and they stores value as 10 and 20 respectively.

Note that when you are going to store string or text in variable do include that string in single quote or double.

If you want to store integer value in variable don't use quotes.

Using that variables as for example:

<?php
 echo $txt; 
echo "<br/>";
echo $x;
echo "<br/>";
echo $y;
echo "<br/>";

$z=$x$y;
echo $z;

 ?>

Output:
Hello word!
10
20
30

Explaination:
echo is construct we use to print in PHP. There is <br/> tag used with this echo that is for print new line.
$z stores sum of $x and $y.

In PHP we don't specify data type of variable, it automatically recognize.

That's it for this post, will post something important in next post, stay connected.

How to find PHP version through command prompt in windows?

How to find PHP version through command prompt in windows?



This question may get asked in PHP interview.

You just need to find out where is your PHP folder. If you are using XAMPP or WAMP then you will see a php folder. You just need to go into the php folder as:
 xampp -> php
wamp -> php

Now open command prompt here, And then just type in this command as :

   C:\xampp\php>php -v

    Then you will see something like:

PHP 5.5.19 (cli) (built: Nov 12 2014 12:35:44)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies


C:\xampp\php>

Your command prompt window should like this:


----
Keep reading, keep learning.

PHP Developer Salary: How much does a PHP Developer make?





In India, It's depends upon company, location and your skills. An average starting annual salary of php developer is near to 90,0000 INR that goes up to 4.50 lakhs in a three years of time.

In India, starts from as low as 8k/month to as high as 1.5L/month. Although low paying sections are more occupied.

As a programmer you need to have a very good understanding of how development technologies works in general and how are they co-related.

Summary:
For Freshers its 8-12K.
After 1 year - 16K
After 2 year - 22K
After 3 Year - 30K
After 4 Year - 36K
After 5 Year - Upto 45K
-60K


PHP Developer Salary depends on experience, logic, ideas, innovation, contacts, business development etc etc stuff. 

Learn and earn. 




Walk Ins for PHP Developer (16th and 17th Aug'16) : Noida

About Chetu:
Founded in 2000, Chetu is SAS 70 Type II Certified Global Information Technology Company that specializes in Application software development, Systems integration, business intelligence, mobile and Infrastructure Support. 


Experience required for the Job: 2 - 4 years

Interview at Chetu India (P) Ltd
Information Technology Services for the position of PHP Developer. 


Required Skills:-
- Experience in PHP & MySQL, various open source frameworks,
- Strong knowledge of JavaScript, XHTML, CSS, AJAX, SQL.
- Excellent communication, self motivator, team player, ability to solve complex problems, design & requirements documentation.


Job Location:- Noida.

Venue Details: 
Chetu India (P) Ltd. - Software Development Excellence
A - 186/187, Sector 63, 
Noida UP - 201301.
Opposite Fortis Hospital







Contact:
Siddarth Thakur
HR Team
Chetu India Pvt Ltd - Delivering World-Class IT Solutions
Office IN : 0120-4237301 | URL : www.chetu.com