menu

PHP Functions


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

count()

length()

size()

array_length()


2. Which PHP function is used to get the current date and time?

date()

time()

now()

datetime()


3. Which PHP function is used to replace a portion of a string with another string?

str_replace()

replace()

string_replace()

swap()


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

htmlentities()

encode_html()

html_encode()

make_html_entities()


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

error_get_last()

last_error()

get_error()

error_message()


6. Which PHP function is used to convert a string to an array?

explode()

string_to_array()

str_array()

make_array()


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

array_push()

add()

insert()

push()


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

strtolower()

to_lowercase()

lower()

convert_lower()


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

urlencode()

encode_url()

url_encode()

encode()


10. Which PHP function is used to remove white space from the beginning and end of a string?

trim()

remove_whitespace()

strip()

clean()