Top 40 Jenkins Interview Questions And Answers For Freshers/Experienced
If you are looking for a career in software development, then Jenkins is definitely worth exploring. This widely used …
PHP is a very important language for development and is generally used in today’s world. So because of its popularity companies directly hire PHP developers. So if you are appearing for any such post then you need to well-prepare the interview from PHP Interview Questions and Answers. In this, we have covered most of the PHP interview questions for better preparation.
About PHP: PHP (PHP: Hypertext Preprocessor) is a very much used, open-source scripting language that is suited for web development. It is the first server-side language that can embed with HTML, making it smooth to add functionality to web pages with no need to call external files. Read on to learn PHP Interview Questions And Answers.
Also, prepare for Embedded C interview questions, Networking interview questions, and other language interview questions from here.
4. Which PHP version is actually used in working?
5. Which command line is used to execute a PHP script?
6. How to run the PHP shell from the CLI?
7. What are the best two common ways to start and end a PHP block of code?
8. Tell the tags to directly display the output to the browser?
9. Tell the one most important difference between PHP 4 and PHP 5?
10. Does PHP support multiple inheritances?
11. Explain the final class and a final method?
12. In PHP how objects comparison is done?
13. Explain the type of operation required to pass values through a form or an URL?
14. Tell us how PHP and Javascript interact with each other?
15. What is required to use the image function?
16. Explain the use of ‘imagetypes()’ function?
17. Tell the functions required to get the image properties like size, width, and height?
18. How to handle failures in execution by using include() and require() functions?
19. Differentiate between require() and require_once()?
20. Show the way to display text with a PHP script?
21. In PHP, is it possible to set an infinite execution time?
22. Tell the use of file_get_contents() function?
23. Tell the way to connect a MySQL database from a PHP script?
24. Tell the use of mysql_pconnect() function?
25. How to handle the result set of Mysql in PHP?
26. Which function is used to remember the number of rows returned in the result set?
27. Tell the function that provides the number of affected entries by a SQL query?
28. Differentiate mysqli_fetch_object() and mysqli_fetch_array()?
29. Tell the way to access the data sent via URL with the GET method?
30. Tell the way to access the data sent via the URL with the POST method?
31. Tell the way to check the given variable value is a number?
32. Tell the way to check the given variable value is alphanumeric?
33. How do we come to know if the given variable is empty?
34. Explain the unlink() function?
35. Explain the unset() function?
36. Tell the way to escape data before storage into the database?
37. Tell the way to remove escape characters from a string?
38. Tell the way to automatically escape incoming data?
39. Explain get_magic_quotes_gpc() function?
40. How do we remove the HTML tags from data?
41. what is the use of a static variable in function?
42. Tell the way to return a value from a function?
43. Which cryptographic extension does verification of digital signatures?
44. How to define a constant in a PHP script?
45. How are you able to pass a variable by reference?
46. Do we compare an integer 12 and a string “13” in PHP?
48. How to use the ternary conditional operator in PHP?
49. What is the use of func_num_args() function?
4. Which PHP version is actually used in working?
5. Which command line is used to execute a PHP script?
You need to use the PHP command-line interface (CLI) and mention the file name of the PHP script to be executed. For example:
php script.php
6. How to run the PHP shell from the CLI?
You need to use the PHP command-line interface (CLI) program with option -a as given:
php -a
7. What are the best two common ways to start and end a PHP block of code?
The best two common ways to start and end a PHP script are:
<?php [ --- PHP code---- ] ?>
and
<? [--- PHP code ---] ?>
8. Tell the tags to directly display the output to the browser?
9. Tell the one most important difference between PHP 4 and PHP 5?
10. Does PHP support multiple inheritances?
11. Explain the final class and a final method?
12. In PHP how objects comparison is done?
13. Explain the type of operation required to pass values through a form or an URL?
14. Tell us how PHP and Javascript interact with each other?
15. What is required to use the image function?
16. Explain the use of ‘imagetypes()’ function?
17. Tell the functions required to get the image properties like size, width, and height?
18. How to handle failures in execution by using include() and require() functions?
19. Differentiate between require() and require_once()?
20. Show the way to display text with a PHP script?
Two methods that are possible is:
<!--?php echo "Method 1"; print "Method 2"; ?-->
21. In PHP, is it possible to set an infinite execution time?
22. Tell the use of file_get_contents() function?
file_get_contents() allows reading a file and saving it in a string variable.
Know the Interview Criteria of these MNCs!!!
23. Tell the way to connect a MySQL database from a PHP script?
Use mysqli_connect() function to connect a MySQL database from a PHP script as follows:
<!--?php $database = mysqli_connect("HOST", "USER_NAME", "PASSWORD"); mysqli_select_db($database,"DATABASE_NAME"); ?-->
24. Tell the use of mysql_pconnect() function?
25. How to handle the result set of Mysql in PHP?
26. Which function is used to remember the number of rows returned in the result set?
27. Tell the function that provides the number of affected entries by a SQL query?
28. Differentiate mysqli_fetch_object() and mysqli_fetch_array()?
29. Tell the way to access the data sent via URL with the GET method?
To access the data sent through URL by using the GET method, we use $_GET array, as shown:
$variable = $_GET["var"]; this will now contain 'value'
30. Tell the way to access the data sent via the URL with the POST method?
To access the data sent through URL by using the POST method, we use the $_POST array.
Let assume, you have a form field called ‘var’, so, whenever the user presses submit to the post the form, the value you’ll get is something like this:
$_POST["var"];
31. Tell the way to check the given variable value is a number?
32. Tell the way to check the given variable value is alphanumeric?
33. How do we come to know if the given variable is empty?
34. Explain the unlink() function?
35. Explain the unset() function?
36. Tell the way to escape data before storage into the database?
37. Tell the way to remove escape characters from a string?
38. Tell the way to automatically escape incoming data?
39. Explain get_magic_quotes_gpc() function?
40. How do we remove the HTML tags from data?
41. what is the use of a static variable in function?
It is defined only for the first time in a function, and its value can be changed during function calls, such as:
<!--?php function testFunction() { static $testVariable = 1; echo $testVariable; $testVariable++; } testFunction(); //1 testFunction(); //2 testFunction(); //3 ?-->
42. Tell the way to return a value from a function?
43. Which cryptographic extension does verification of digital signatures?
44. How to define a constant in a PHP script?
By using a command define() directive, we can define a constant in a PHP script which is as follows:
define ("ACONSTANT", 123);
45. How are you able to pass a variable by reference?
To pass a variable by reference, you just need to use an ampersand (&) in front of it, for example,
$var1 = &$var2
46. Do we compare an integer 12 and a string “13” in PHP?
48. How to use the ternary conditional operator in PHP?
It is made of three expressions: a condition, and two operands which define what instruction should be performed when the particular condition is true or false:
Expression_1?Expression_2 : Expression_3;
49. What is the use of func_num_args() function?
A session is a logical object that allows us to save temporary data across different PHP pages.
It is one of the most important languages so we suggest you prepare well and crack the job interview. For more questions about different languages explore our website.
If you are looking for a career in software development, then Jenkins is definitely worth exploring. This widely used …
In this post, we will cover a few Linux interview questions and their answers. So, let’s get started. In this …