• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
Switch to Dark Mode

PHP Quiz | Set-2

Last Updated : Apr 2, 2024
Discuss
Comments

Question 1

Which below method is used to compute the difference between two arrays in PHP?
  • A
    array_diff
  • B
    diff_array
  • C
    arrays_diff
  • D
    diff_arrays

Question 2

What is the output of the following code snippets: <?php $output = array(3, 3, 3); echo array_product($a); ?>

  • A
    8
  • B
    27
  • C
    10
  • D
    6

Question 3

Which of the following method in PHP is used to get the current day and location?

  • A

    date_sunrise()

  • B

    sunrise()

  • C

    date-sunrise()

  • D

    None of the above

Question 4

What is the output of the below code snippets?

<?php    
 	$value="GeeksForGeeks";    
 	echo strrev("$value");      
?>
  • A

    skeeGroFskeeG

  • B

    skeeGroFskeeO

  • C

    skeeGorFskeeG

  • D

    skeeForFskeeG

Question 5

What is the output of the below code snippets?
<?php  
	while()  
	{  
	echo "GeeksForGeeks";  
	}  
?> 
  • A
    Hello World
  • B
    Infinite loop
  • C
    no output
  • D
    Error

Question 6

Which of the following is used to calculate a number of character values in PHP?

  • A

    count($variable)

  • B

    len($variable)

  • C

    strcount($variable)

  • D

    strlen($variable)

Question 7

Which of the following is not considered predefined values?

  • A

    $get

  • B

    $ask

  • C

    $request

  • D

    $post

Question 8

Which of the following is true if you want to send input through the script in PHP?

  • A

    Post

  • B

    Get

  • C

    All of the above

  • D

    None of the above

Question 9

The correct syntax for enclosing the PHP script are?

  • A

    <PHPgt; </phpgt;

  • B

    <?PHP ?gt;

  • C

    ?PHP ?PHP

  • D

    <p?gt; </?pgt;

Question 10

How many types of filtering is present in PHP?

  • A

    2

  • B

    3

  • C

    4

  • D

    None

Ready to go from coding beginner to development pro? Our DSA to Development Coding Guide has everything you need to crush coding interviews and ace real-world projects! Limited spots available!
Enroll Now and Transform Your Coding Skills! Also get 90% fee refund on completing 90% of the course in 90 days! Take the Three 90 Challenge today.

There are 15 questions to complete.

Take a part in the ongoing discussion