PHP Logical & Programming Interview questions

Here is the list of top 10 PHP Programs Asked to write you in your next PHP Interviews for 1 year Php Experience or PHP Fresher.

#1 Question

Write a program in Php to check whether a number is prime or not?

#2 Question

Write a program to find no of days between two dates in Php?

#3 Question

Write a program in PHP to find the occurrence of a word in a string?

#4 Question

Write a program to upload a file in PHP?

#5 Question

Write a program to find a string is palindrome or not?

#6 Question

Write a program to find the factorial of a number in PHP?

#7 Question

Php Code to find whether a number Armstrong or not?

#8 Question

Php Program to generate Fibonacci series?

#9 Question

Write a program in PHP to print a table of a number?

#10 Question

Write a program in PHP to reverse a number?

#11 Question

 Write a PHP function to convert all null values to blank?

When we are outputting our results into JSON for purpose of web services then It is a good practice to convert all null value to an empty string, below is simple PHP function to convert all null values to blank.


function convertNullToBlank($array){

foreach ($array as $key => $value) {
if (is_null($value)) {
$array[$key] = "";
}
}
return $array;

}

Above function takes an array as an argument and converts it all null values to blank.

Ask a Question