Top Php Interview Questions and Answers For Freshers Experienced Candidates

php interview questions-developer-gang

PHP is a server-side scripting language used for web development. RASMUS LERDORF is the father of PHP. PHP 5 and the above php 5 versions works with MySQLi (Database Management System). here i Stands for ** Improved **.

Important PHP Interview Questions

What is the difference between the wp_title and the_title tags?

The wp_title and the the_title both are the different functions of WordPress and have a different ...

Convert (div) Html to Image using Javascript html2canvas with Example and Save using Ajax, PHP.

Sometimes you need to convert your entire div to the image. In this post, I am going to Convert the ...

Create a chess board using for loop php

In this Post we will create a chessboard pattern, an 8×8 grid of black and white squares like ...

PHP reverse number program

It is very easy to reverse a number using PHP string function strrev(). But here i will show you ...

What is the difference between single quotes and double quotes?

Single quoted strings will display things almost completely “as is.” Variables and ...

What is the Scope Resolution Operator?

“::” double colons is the scope operator it is used to call methods of a class that ...

How do you load classes in PHP?

Review the “autoload” and “spl_autoload_register” function (note:you ...

What is Polymorphism?

It’s simply the idea that one object can can take on many forms. So in PHP OOP one class & ...

In a PHP class what are the three visibility keywords of a property or method?

public, private and protected. The default is public. Public -> Any class may instantiate the ...

How we can retrieve the data in the result set of MySQL using PHP?

1. mysql_fetch_row This function will return a row where the values will come in the order as they ...

Write a program using while loop

$my_query = mysql_query(\"SELECT * FROM \'users\' WHERE \'id\'=\'1\'; \"); while($result = ...

what types of loops exist in php?

In PHP, we have the following looping statements: while – loops through a block of code as ...

What is Open Source Software?

Software in which the source codes are freely used, modify, and shared by anyone are called Open ...

How to create a session? How to set a value in session ? How to Remove data from a session?

Create session : session_start(); Set value into session : $_SESSION=1; Remove data from a: ...

How to set cookies in PHP?

Setting new cookie ============================= Getting Cookie ============================= ...

What is the difference between Session and Cookie?

The main difference between sessions and cookies is that sessions are stored on the server, and ...

How to declare an array in php?

Just Follow the Below example::: Eg : var $arr = array(‘apple’, ‘grape’, & ...

require_once(), require(), include().What is difference between them?

require() includes and evaluates a specific file, while require_once() does that only if it has ...

What are some of the big changes PHP has gone through in the past few years?

There are a number, but the big ones people are looking for are: a. PHP 5.0 realised the object ...

Explain how a PHP session works?

A PHP session cookie is set in the clients browser, on every request the client sends that cookie ...

What are the different tables present in mysql?

Total 5 types of tables we can create 1. MyISAM 2. Heap 3. Merge 4. InnoDB 5. ISAM 6. BDB ...

What is MVC?

Most programmers know this, but interviewers will likely look for a deep understanding of MVC, and ...

In PHP what is the difference between a Class and an Interface?

Interfaces do not contain business logic, only method signatures that define a template that any ...

Who is the father of php and explain the changes in php versions?

Rasmus Lerdorf for version changes go to http://php.net/ Marco Tabini is the founder and publisher ...

What is the use of “echo” in php?

It is used to print a data in the webpage, Example: , The following code print the text in the ...

What is PHP?

PHP is a server side scripting language commonly used for web applications. PHP has many ...

What is Object Oriented Programming?

This is usually a pretty open ended question. You should understand classes (objects are ...

What is difference between echo() and print()?

introduction: echo and print both are used to display output in PHP. echo/print both can be used ...

What is difference between require() and include()?

require() and include() both are used for including files in PHP. When you include a file using ...

Blog is a necessary part to be included in a WordPress Website?

No, it is not a necessary part. Although WP was first designed as a platform for blogging now it can ...

Briefly explain the procedure to pass a variable by value in WordPress?

Passing a variable by value in WordPress is similar to as that in C++. We have to just add an ...

Alternative CMS of WordPress?

Joomla Drupal Ghost Movable Type Silver Stripe ...

prefix of WordPress tables by default?

By default, wp_ is the prefix ...

What’s the difference between site_url() and home_url()?

The site_url() will always be the location where you can reach the site by tacking on /wp-admin on ...

How to create Custom Taxonomy specific to a Custom Post type?

First of all, if you want to show taxonomy meta box only to custom post type then register the ...

What options are there to implement a multi language site ?

WordPress has no bi/multi-language feature built in by default. The other road would be to extend ...

How to Create Custom Post Type?

Custom post types are new post types you can create. A custom post type can be added to WordPress ...

How to modify the parent theme behavior within the child theme?

The child theme could optionally override other template files like author.php, category.php, ...

How to write the short code in WordPress php file?

sing do_shortcode() function inside of php tag. A very simple solution is to use the() ...

How Custom theme is different than Normal theme?

The custom theme allows for SEO search, but with an SEO plugin available it would not make much ...

What are the file structure in wordpress.

Following are main files which used in wordpress index.php :- for index page. search.php :- For ...

What are the rules that you have to follow for wordpress plugin development?

Following are the rules that can be followed for plugin development—>> Create a unique ...

how Magento can be made more secure for the client?

Best practices for Magento includes Using a strong password and changing them at regular interval ...

How to add an external javascript/css file to Magento?

Check out the below code. css/yourstyle.css or skin_jsjs/ yourfile.js skin_csscss/yourstyle. css ...

$message vs. $$message in PHP.

$message is a variable with a fixed name. $$message is a variable whose name is stored in . ...

How send email using php?

To send email using PHP, You use the mail() function.This mail() function accepts 5 parameters as ...

What are the different types of errors in PHP?

There are three types of errors in PHP. 1. Notice: These are very normal and non-critical errors ...

What is PEAR in PHP?

PEAR stands for “PHP Extension and Application Repository”. PEAR provides an inbuilt library of ...

What is the difference between GET and POST method?

Whenever we fill any form on the internet we can use one from two methods to send data on the ...

What is MVC?

MVC stands for Model, View, and Controller. PHP MVC is an effective way to manage the code into 3 ...

Fatal error: Allowed memory size of 67108864 bytes exhausted in WordPress

Sometimes we found that error: Fatal error: the Allowed memory size of 67108864 bytes exhausted. ...

How to get the date of post in a separate day, month and year variables wordpress.??

Sometimes our custom design requires Day, month and year in a seprate or wow looking format… ...

How to redirect a page in php?

very easy way: header(“Location:index.php”); // here index.php is the page where we ...

What is difference between require_once() and require()??

The main and basic difference between them is ….. When we use require_once() to include the ...

How to include a file to a php page?

We can include a file using ” include(); ” or ” require(); ” function with ...

How to use .xml and ppk file to connect with FTP (File Transfer Protocol)?

In some cases, Client provides us the .xml file and .ppk extension file to connect with the ftp ...

how to submit a form without submit button php jquery javascript??

Another easy way to save a form without using a submmit button is javascript. Suppose we have a ...

What is the use of in_array() function in PHP?

If you want to check particular value exists in an array or not,then you can use in_array() ...

What is difference between echo() and print()?

introduction: echo and print both are used to display output in PHP. echo/print both can be used ...

What is difference between require() and include()?

require() and include() both are used for including files in PHP. When you include a file using ...

Updating WordPress on local server (max execution time)

for temporarily increasing your max execution time you can use ini_set() in your php page(\' ...