Logo

Php Questions Set 24:

Quiz Mode

 In PHP a variable needs to be declare before assign 

1
2

Solution:

What will be the output of the following PHP code?

1
2
3
4

Solution:

 Which character does the error_reporting directive use to represent the logical operator NOT? 

1
2
3
4

Solution:

 Which one of the following function is used to start a session? 

1
2
3
4

Solution:

Which one of the following functions will convert a string to all uppercase? 

1
2
3
4

Solution:

Which of the following functions is responsible for sending a custom message to the system log?

1
2
3
4

Solution:

Which one of the following is the right way to invoke a method? 

1
2
3
4

Solution:

  How to define a function in PHP? 

1
2
3
4

Solution:

 

What will be the output of the following PHP code?

<?php

$author = "nachiketh@example.com";

$author = str_replace("a","@",$author);

echo "Contact the author of this article at $author.";

?>

1
2
3
4

Solution:

 Which of the following is/are true for an abstract class?
i) Abstract classes in PHP are declared with the help of the abstract keyword.
ii) A class is declared abstract by using the keyword implements.
iii) It is a class that really isn’t supposed to ever be instantiated but instead serves as a base class.
iv) Attempting to instantiate an abstract class results in an error. 

1
2
3
4

Solution: