Logo

Php Questions Set 46:

Quiz Mode

What will be the output of the following PHP code?


<?php echo ord("hi"); ?>

1
2
3
4

Solution:

Which one of the following functions is used to determine object type?

1
2
3
4

Solution:

 Which function is used to verify whether a variable contains a value? 

 

1
2
3
4

Solution:

The function used to determine a file's last access time is ____.

1
2
3
4

Solution:

What will be the output of the following PHP code?

<?php

$x = 20;

$y = 10;

$z = 6;

if ($x / $y / $z)

echo "hi";

else

echo "hello";

?>

1
2
3
4

Solution:

What will be the output of the following PHP code?

<?php $x; if ($x == 0) print "hi"; else print "how are u"; print "hello"; ?>

1
2
3
4

Solution:

What will be the output of following PHP code?

<?php

    function a()

    {

        function b()

        {

            echo 'I am b';

  }

        echo 'I am a';

    }

    a();

    a();

?>


1
2
3
4

Solution:

In the following PHP code, what is/are the properties?


    <?php

    class Example 

    {

        public $name;

        function Sample()

        {

            echo "This is an example";

        }

    } 

    ?>

1
2
3
4

Solution:

 

What will be the output of the following PHP code?

<?php

$title = "O'malley wins the heavyweight championship!";

echo ucwords($title);

?>

1
2
3
4

Solution:


What is the output of the following PHP code?


<?php

    $a = array("a" => "India", "b" => "Russia", "c" => "China");

    echo array_shift($a);

    echo "<br>";

    array_pop($a);

    print_r($a);

?>

1
2
3
4

Solution: