Top 35 Frequently Asked PHP Interview Questions And Answers for 1 year experience

PHP interview questions image

According to my experience here I am sharing top 35 frequently asked PHP interview questions and answers for 1 year experiences PHP developer, This list of PHP interview questions and answers will be helpful for PHP experience developer. Question #1 – What is the difference between $message and $$message? They are both variables But $message is a variable with a fixed name. $$message is a variable whose name is stored in $message. For example, if $message contains “var”, $$message is the same as $var. Question #2 – How to include a file…

Adding Two Numbers in PHP

PHP add two numbers program image

We can add two numbers in PHP as like other programming language. “Two Numbers Addition” is the initial program from where most of the beginner developers will start to learn and write code in any language. Here is an example of add two numbers in PHP. Adding Two Numbers Program :- We use $ symbol to declare variable and add two variables. we take third number to store result in third variable. Below is the simple PHP program to add two numbers. <?php $first=30; $second=20; $third=$first + $second; echo “Two Numbers Sum:…

Prime Number Program in PHP

PHP prime number program image

Prime Number :-  A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. For example, 3 is a prime number because it has no positive divisors other than 1 and 3. Prime numbers are below:- 2, 3, 5, 7, 11, 13, 17, 19 …. Here I am writing the PHP program to check whether a number is Prime or not. <?php function CheckPrime($number){ for($x=2;$x<$number;$x++){ if($number%$x == 0){ return 0; } } return 1; } $a = CheckPrime(17); if ($a==0) echo ‘This is not…

Palindrome Number Program in PHP

PHP palindrome number program image

Palindrome Number :- A palindromic number or numeral palindrome is a number that remains the same when its digits are reversed. Like 53235,  Below are the example palindrome number:- 121 , 212 , 12321 , 16461 #Steps to Check a Palindrome Number :- Take a Number Now reverse its digit Now compare both the numbers if both are equals to each other then return “Number is Palindrome“. else return “Number is not Palindrome“ Here I am writing the PHP program to check whether a number is palindrome or not. Palindrome Number Program Without of Using PHP…

Fibonacci Series in PHP

PHP Fibonacci series program image

Fibonacci series means to get next term by adding its previous two numbers. For an example:- 0 1 1 2 3 5 8 13 21 Here I am writing the PHP program to print Fibonacci Series. <?php function printFabonacciSeries($number){ $a = 0; // first number of series $b = 1; // second number of series echo ‘Fabonacci Series <br/>’; echo $a.’ ‘.$b; for($i=2;$i<$number;$i++){ $c = $a + $b; //print next number of series echo ‘ ‘.$third; $a = $b; $b = $c; } } printFabonacciSeries(9); ?> Output :- 0 1 1 2 3 5 8 13 21 Alternate Way…

How to Print Hello World Program in PHP ?

Hello World PHP program image

In PHP it is very easy to print “Hello World” program. “Hello World.” is the first program from where most of the beginner developers will start to write code in any language. Here is an example of how to print “Hello World!!” in PHP. Print “Hello World” Program :- In PHP we use echo to print a string and we always write the PHP code between <?php ?>  tag. Below are the example of print simple Hello World. <?php echo “Hello World!!”; ?> Output :- Hello World!! Check video :-

PHP Introduction

PHP introduction programming image

What is PHP:- PHP stands for PHP: Hypertext Preprocessor , it is widely – used server side scripting  language designed for web devlopment. PHP also used as a general purpose programming language. It was build up by Rasmus Lerdorf in 1994 and launched in the market in 1995. PHP is the most well known scripting language on the web. It is utilized to improve site pages. Using PHP, you can do things like a login page and login a user by creating session, check details from a form, create forums, picture galleries, surveys, and…

Top 35 PHP Interview Questions and Answers for 5 year experience

PHP interview questions image

This article shows top 35 frequently asked PHP interview questions and answers for 5 years experienced PHP Developer, This list of PHP interview questions and answers will be helpful for PHP 5 experienced developer. Question #1 – How array_walk function works in PHP? It is used to update the elements/index of original array. How: in array_walk, two parameter are required.  original array An callback function, with use of we update the array.  Question #2 – What is the difference between $message and $$message? They are both variables But $message is a…

Top 35 PHP Interview Questions And Answers for 2 year experience

PHP interview questions image

In this article I am sharing top 35 frequently asked PHP interview questions and answers for experience, This list of PHP interview questions and answers will be helpful for PHP experience developer. Question #1 – What is PHP? PHP is an open source server side scripting language mostly used for web applications. Its easy to learn compare to other programming language. PHP also a object oriented programming language like java, .net and c++. Question #2 – What is the difference between $message and $$message? They are both variables But $message is…

Factorial Program in PHP

PHP factorial program tutorial image

image source : google images The factorial of number n is multiplying given integer with the sequence of its descending positive integers. we denoted the factorial of a number n by n! in mathematics. Here I am writing factorial program in PHP.. Example :- 5! = 5*4*3*2*1 = 120 7! = 7*6*5*4*3*2*1 = 5040   Here are writing the PHP program to find a factorial of a number. <?php function factorial($number){ $factorial = 1; for($x=$number;$x>=1;$x–){ $factorial = $factorial*$x; } return $factorial; } echo ‘factorial is=’.factorial(11); ?>   Output :- factorial…