menu

PHP Functions


1. Which PHP function is used to redirect a user to a different URL?

header()

redirect()

location()

navigate()


2. Which PHP function is used to check if a file exists?

file_exists()

exists_file()

check_file()

file_check()


3. Which PHP function is used to remove elements from an array?

unset()

remove()

delete()

pop()


4. Which PHP function is used to check if a variable is empty?

empty()

is_empty()

check_empty()

var_empty()


5. Which PHP function is used to sort an array in ascending order?

sort()

ascending()

order()

arrange()


6. Which PHP function is used to get the last error message?

error_get_last()

last_error()

get_error()

error_message()


7. Which PHP function is used to get the current timestamp?

time()

current_time()

timestamp()

now()


8. Which PHP function is used to get the length of an array?

count()

length()

size()

array_length()


9. Which PHP function is used to remove duplicate values from an array?

array_unique()

unique()

remove_duplicates()

deduplicate()


10. Which PHP function is used to get the value of a specific cookie?

$_COOKIE[]

get_cookie()

cookie_value()

fetch_cookie()