Logo

Php Questions Set 30:

Quiz Mode

What will be the output of the following PHP code?

1
2
3
4

Solution:

There are _____ configuration directives pertinent to PHP's mail function.

1
2
3
4

Solution:

The filesize() function returns the file size in what unit?

1
2
3
4

Solution:

The _____ method is an object-oriented version of the date() function.

1
2
3
4

Solution:

 Which of the following PHP functions can be used to get the current memory usage? 

1
2
3
4

Solution:

Which PHP directive should be used to disable just the fopen() and file() functions?

1
2
3
4

Solution:

What is the output of the following PHP code?

<?php

$username = "jasoN";

if (ereg("([^a-z])",$username))

echo "Username must be all lowercase!";

else

echo "Username is all lowercase!";

?>

1
2
3
4

Solution:

What will be the output of the following PHP code? 

<?php

    $username = "saRthaK";

    if (ereg("([^a-z])",$username))

        echo "Username must be all lowercase!";

    else

        echo "Username is all lowercase!";

    ?>



1
2
3
4

Solution:

What will be the output of the following PHP code?


<?php

    $names = array("Ram", "Bharat", "Laxman");

    echo $names[0] . "is the brother of " . $names[1] . " and " . $names[1] . ".";

?>

1
2
3
4

Solution:

What will be the output of the following code?


<?php

    function convertSpace($string)

    {

        return str_replace("_", " ", $string);

    }

    $string = "Peter_is_a_great_guy!";

    echo filter_var($string, FILTER_CALLBACK, array("options"=>"convertSpace"));

    ?>

1
2
3
4

Solution: