menu

PHP Functions


1. Which PHP function is used to convert a string to lowercase?

strtolower()

to_lowercase()

lower()

convert_lower()


2. Which PHP function is used to add elements to the end of an array?

array_push()

add()

insert()

push()


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

file_exists()

exists_file()

check_file()

file_check()


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

time()

current_time()

timestamp()

now()


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

count()

length()

size()

array_length()


6. Which PHP function is used to generate a unique ID?

uniqid()

unique_id()

gen_id()

create_id()


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

error_get_last()

last_error()

get_error()

error_message()


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

header()

redirect()

location()

navigate()


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

sort()

ascending()

order()

arrange()


10. Which PHP function is used to get the MIME type of a file?

mime_content_type()

file_mime_type()

get_mime_type()

mime_type()