php mcq questions with answers


                                
What is the function of backtick (`) characters in PHP?
A.Same as single-quotes, used to enclose strings.
B.Escape operators.
C.No special meaning.
D.Execute the enclosed string as a command.
E.Error control operators.
                                
You want to access the 3rd character of a string, contained in the variable $testWhich of the following possibilites work?(Choose 2)
A.echo $test(3)
B.echo $test[2];
C.echo $test(2);
D.echo $test{2};
E.echo $test{3}
                                
What will the following function call return? strstr('http://example.com/test/file.php', '/');
A./example.com/
B./file.php
C.file.php
D.//example.com/test/file.php
                                
What is the length of a string returned by: md5(rand(), TRUE);
A.Depends on the value returned by rand() function
B.32
C.24
D.16
E.64
                                
What will the $array array contain at the end of this script? <?php function modifyArray (&$array) { foreach ($array as &$value) { $value = $value + 1; } $value = $value + 2; } $array = array (1, 2, 3); modifyArray($array); ?>
A.2, 3, 4
B.2, 3, 6
C.4, 5, 6
D.1, 2, 3