Coding Archive

Switch Statement in PHP

Switch statement in PHP allows executing a single block of code out of many. Switch statements are a little bit faster compare to the if-else statements because instead of checking each and every statement it directly executes the target block …

Loops in PHP

Loops are the blocks used for executing the same code repeatedly.  There are following loops in PHP. for Loop while Loop do-while Loop foreach Loop   for Loop: for Loop in PHP execute the same code specified in its parameter. …

PHP Interview Programs

Problem 26: What would be the output of following: OUTPUT: 1   // $b value will be 1 21  // $c value will be 21 as 2 is concatenated to the value of $b Problem 27: What would be …

PHP Interview Programs

Problem 16: Write a Program to swap two numbers in PHP. Problem 17: Write a Program for Bubble sorting in PHP. Problem 18: Write a Program for finding the smallest number in an array. Problem 19:  Write …