PHP Quiz | Set-3

  • Last Updated : 20 Sep, 2021

Question 1
Which inbuilt function in PHP is used to sort the element in Descending order?
A
sort()
B
asort()
C
dsort()
D
rsort()
PHP Quiz | Set-3    
Discuss it


Question 1 Explanation: 
In array sort() is used to sort the array in ascending array while on the other hand rsort() is used to sort the array the element in descending order.
Question 2
In PHP if we put the element in the new line then which of the correct symbol is used?
A
\l
B
\n
C
/r
D
/n
PHP Quiz | Set-3    
Discuss it


Question 2 Explanation: 
If we want to put the element below the new line of the sentences for this we have used \n in paragraph.
Question 3
Which of the below data is termed as the external data in PHP?
A
Cookies
B
Web service data
C
Server variables
D
All of the above
PHP Quiz | Set-3    
Discuss it


Question 3 Explanation: 
The external data in PHP are Cookies, Web service data, variable of server, So all option is matched.
Question 4
Which built-in function in the PHP adds value to the end of the array?
A
this_array()
B
is_array()
C
while_array()
D
are_array()
PHP Quiz | Set-3    
Discuss it


Question 4 Explanation: 
The is_array() function is used to add the value to the end of the array. It uses for testing the value.
Question 5
In the array the pointer moves to the previous array position, which of the following function is true?
A
last()
B
before()
C
prev()
D
Previous()
PHP Quiz | Set-3    
Discuss it


Question 5 Explanation: 
The function prev() in PHP is used to set the just previous element in the array.
Question 6
In the PHP the filesize() function returns which of the following size?
A
bits
B
bytes
C
kilobytes
D
gigabytes
PHP Quiz | Set-3    
Discuss it


Question 6 Explanation: 
PHP the filesize() function returns the size of the file in bytes.
Question 7
Which of the following is true about the number of filtering present in Php?
A
1
B
2
C
3
D
All of the above
PHP Quiz | Set-3    
Discuss it


Question 7 Explanation: 
The number of filtration present in their PHP are two that is validation and sanitization.
Question 8
Which of the following function is used to reading the string variable?
A
file_contents()
B
file_get_contents()
C
file_content_get()
D
fget_content()
PHP Quiz | Set-3    
Discuss it


Question 8 Explanation: 
The file_get_contents() is a function in PHP which is used to directly reading the string in PHP.
Question 9
What is the correct output of the below code snippets?
<?php
    $number = "123456";
    if (!filter_var($number, FILTER_VALIDATE_INT))
        echo("Valid");
    else
         echo("Not Valid");
?>
A
Valid
B
Not Valid
C
Error
D
None of the above
PHP Quiz | Set-3    
Discuss it


Question 9 Explanation: 
From the above code snippets the input is stored in the number and we check the number to check FILTER_VALIDATE_INT so if it is true then it returns Valid otherwise it returns Not Valid.
Question 10
If we filter many variables into one then which of the following filter is used?
A
filter_var_array()
B
filter_var()
C
filter_input
D
filter_input_array
PHP Quiz | Set-3    
Discuss it


Question 10 Explanation: 
The filter_var_array() is used to filter many variables into one so we can say that filter_var_array() is used to get multiple variables.
There are 15 questions to complete.

My Personal Notes arrow_drop_up


Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.