Top PHP Interview Questions and Answers

Question 1: How to redirect a page to another? You can use header function to recirect. header(‘location: http://www.web-technology-experts-notes.in”); //Redirect to home page of another website header(‘location: http://www.web-technology-experts-notes.in/2015/11/php-questions-and-answers-for-experienced.html”); //Redirect to another page and another website header(‘location: php-questions-and-answers-for-experienced.html”); //Redirect to another page of same website header(‘location: php-questions-and-answers-for-experienced.html?topic=php”); //Redirect to another page of same website with parameter header(‘Location: […]

Read More »

OOPs Interview Questions and Answers

What is Object Oriented Programming? Object-oriented programming (OOP) is a programming language model organized around objects rather than actions; Objects are instances of classes, are used to interact with one another. Following are few examples of object-oriented programming languages PHP, C++, Objective-C, Smalltalk, C#, Perl, Python, Ruby. The goals of object-oriented programming are: Increased understanding. […]

Read More »

PHP Advanced Interview Questions and Answers

Question: What is PEAR in php? PEAR means PHP Extension and Application Repository. PEAR is a framework and distribution system for reusable PHP components. PEAR can be installed by bringing an automated wizard. Following are main purpose of PEAR A structured opensource library . Distribution and package maintenance. The PHP Foundation Classes (PFC) The PHP […]

Read More »

PHP Interview Questions and Answers for 3 year Experience

Question: How to explode a string using multiple delimiters(“,” and “|” )? $string=’php, interview | questions , and | answers ‘; $output = preg_split( “/(\,|\|)/”, $string ); print_r($output ); /* Array ( [0] => php [1] => interview [2] => questions [3] => and [4] => answers ) */ Question: What is Late static bindings […]

Read More »

PHP interview questions and answers for experienced

Question: How to POST Data using CURL in PHP? $url = “http://www.example.com/ajax/testurl”; $postData = ‘this is raw data’; try { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$postData); curl_setopt($ch, CURLOPT_HTTPHEADER, array(‘Content-Type: text/plain’)); echo $output = curl_exec($ch); curl_close($ch); } catch (Exception $e) { echo $e->getMessage();die; } Question: How to re-index […]

Read More »

PHP interview questions and answers for 3 year of experience

Question: Are PHP functions case sensitive? No, functions are case in-sensitive In built functions are are case-insensitive like print, strtolower, array_merge etc. user defined functions are also are case-insensitive (New function created by user as per requirment). Question: How to return call by reference value from function? Just use &(ampersand) before the function name. For […]

Read More »

ThinkPHP framework SQL queries with examples

Question: How to create Model Object? $userObj= D(“Common/Users”); Question: How to add simple AND Query? $map=array(); $userObj= D(“Common/Users”); $map[‘user_type’] = 2; $map[‘city_id’] = 10; $lists = $userObj ->alias(“u”) ->where($map) ->order(“u.id DESC”) ->select(); Question: How to add simple OR Query? $map=array(); $userObj= D(“Common/Users”); $map[‘u.username|u.email’] = ’email@domain.com’; //username OR email is email@domain.com $lists = $userObj ->alias(“u”) ->where($map) […]

Read More »

PHP Redis Interview questions and answers

Question: Why Redis is different as compared to other key-value stores? Redis values can contain more complex data types, with atomic operations. Redis is an in-memory but persistent on disk database. Question: How to delete current database? redis-cli flushdb Question: How to remove all database? redis-cli flushall Question: How to check redis is running? try […]

Read More »

Fresher PHP Interview Questions and Answers

Question: What is PHP? Answer:  PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.   Question: What is name of function that allows you to store session data in a database? Answer: session_set_save_handler   Question: What is obj_start()? Answer:It is used to initialize the […]

Read More »

Xamarin Forms Overview

Are you new to Xamarin Forms or just wondering how it all connects together? This is a very quick and basic overview of the components and how they fit together. When you create a new Xamarin Forms solution you do 2 things. Create a common PCL that will contain all your views and app code. This […]

Read More »