menu

PHP Functions


1. Which PHP function is used to encode a string into HTML entities?

htmlentities()

encode_html()

html_encode()

make_html_entities()


2. Which PHP function is used to round a number to the nearest integer?

round()

ceil()

floor()

int()


3. Which PHP function is used to encode a URL?

urlencode()

encode_url()

url_encode()

encode()


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

header()

redirect()

location()

navigate()


5. Which PHP function is used to convert a string to uppercase?

strtoupper()

to_uppercase()

upper()

convert_upper()


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 check if a file exists?

file_exists()

exists_file()

check_file()

file_check()


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

array_push()

add()

insert()

push()


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

error_get_last()

last_error()

get_error()

error_message()


10. Which PHP function is used to calculate the absolute value of a number?

abs()

absolute()

val()

value()