PHP Interview Questions & Answers

Showing 10 of 109 questions | Page 5

PHP technical interview questions and answers are essential for candidates preparing for web development roles. PHP powers millions of websites and content management systems, so companies often evaluate your knowledge of syntax, arrays, sessions, cookies, form handling, OOP concepts, and database connectivity. Popular companies like TCS, Wipro, Infosys, Capgemini, Cognizant, and Accenture regularly include PHP questions in coding rounds and technical interviews. This guide explains the most frequently asked PHP interview questions with simple examples and clear definitions. Whether you are a fresher preparing for campus placements or an experienced developer, these questions will help you understand PHP concepts better. You can also download PHP interview PDFs and practice mock questions for better preparation.

Web developers should complement their PHP skills with MySQL database  knowledge and JavaScript programming for full-stack development 

Showing 10 of 109 questions

41. How many values can the SET function of MySQL take?

MySQL SET function can take zero or more values, but at the maximum it can take 64 values.

42. What are the other commands to know the structure of a table using MySQL commands except EXPLAIN command?

DESCRIBE table_name;

43. How can we find the number of rows in a table using MySQL?

Use this for MySQL SELECT COUNT(*) FROM table_name;

44. whats the difference between md5(), crc32() and sha1() crypto on PHP?

The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.

45. How can we find the number of rows in a result set using PHP?

Here is how can you find the number of rows in a result set in PHP: {xtypo_code}$result = mysql_query($any_valid_sql, $database_link); $num_rows = mysql_num_rows($result); echo “$num_rows rows found”;{/xtypo_code}

46. How many ways we can we find the current date using MySQL?

SELECT CURDATE(); SELECT CURRENT_DATE(); SELECT CURTIME(); SELECT CURRENT_TIME();

47. How can we encrypt and decrypt a data present in a mysql table using mysql?

AES_ENCRYPT() and AES_DECRYPT()

48. Will comparison of string “10″ and integer 11 work in PHP?

Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.

49. What is the functionality of MD5 function in PHP?

string md5(string) It calculates the MD5 hash of a string. The hash is a 32-character hexadecimal number.

50. How can I load data from a text file into a table?

The MySQL provides a LOAD DATA INFILE command. You can load data from a file. Great tool but you need to make sure that: a) Data must be delimited b) Data fields must match table columns correctly
Questions and Answers for Competitive Exams Various Entrance Test