Class Name: PHP Developer Recruitment Test
Class Session: Web Developer Recruitment Test - Online
Total Questions: 50 | Duration: 60 Mins
1) Which syntax is valid print statement?
2) How do we connect to a MySQL database from a PHP script?
3) How to retrieve cookie value in a page?
4) IF you want to write a file in php (Eg.test.txt) which syntax is used to write the file?
5) To delete a file in php which function is used?
7) Which function is used to get the image width?
8) Which function is used to get the size width?
10)
What is the output for the below code
$years = 5;
echo 'I have $years of experience';
12) What below code is used to get the first element in below php
13) Which is an example of magical method in php?
14)
What is the output of below code?
echo strspn('abcdefghi','abc');
21)
What is the length of the string?
<?php
echo strlen("Hello world!");
?>
23) From the below variables choose the one which is not a predifined variable?
24) Which function returns the number of characters in a string variable?
25) Each statement in PHP should end with?
26) To get information from a form that is submitted which method is used?
27) To add 1 to the $sum variable which is used?
28) Choose the correct one to add a comment in PHP code?
29)
What is the return value of below code
$Var = substr("learning", -4, 1);
31) What is the output of function Ceil(-4.1) would be
32)
$var = 'MY PHP!';
$var = ucfirst($var);
What is the value of var?
33) To delete a table which statement is used?
34) To read entire content of a file which function is used?
35) choose one correct function to read a single character from a file
36) We need to combine strings $s1 and $s2 into a single string? Choose the one which is wrong syntax?
37) How to check if a function is already defined?
38) Choose the correct answer to change the root directory?
39) Which is correct syntax to create PHP arrays in a HTML <form>?
40) Users IP address are stored in which variable?
41) How to find if a class is already define?
42) To determine object type which function is used?
43)
What will be output of below code?
$a ="php";
$a .="test";
echo "$a";
45) To find files which PHP function is used?
46) Which function is used to sort an array in descending order?
47) To move the pointer to previous array position below function is used?
49)
What will be the output of the following PHP code ?
<?php
$var = '6' ;
print + + $var;
?>
50)
What will be the output of the following PHP code ?
<?php
define('IF', 23);
echo "IF: ", IF;
?>