menu

Web Development With PHP


1. Which of the following is NOT a valid way to concatenate two strings in PHP?

$string1 . $string2

$string1 + $string2

$string1 .= $string2

$string1, $string2


2. Which PHP function is used to encode data in JSON format?

json_encode()

encode_json()

json()

json_format()


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

file_exists()

check_file()

exists_file()

file_check()


4. Which of the following is NOT a valid data type in PHP?

boolean

integer

float

char


5. Which PHP function is used to get the length of a string?

strlen()

strcount()

strlength()

strsize()


6. Which of the following is NOT a valid comparison operator in PHP?

==

!=

<=>

><


7. Which PHP function is used to redirect the user to another web page?

header()

location()

redirect()

navigate()


8. Which PHP function is used to convert a string to all uppercase letters?

to_uppercase()

strtoupper()

upper()

case_upper()


9. Which PHP function is used to convert a string to all uppercase letters?

strtoupper()

upper()

toUpper()

caseUpper()


10. Which PHP function is used to establish a connection to a MySQL database?

mysql_connect()

mysqli_connect()

pdo_connect()

sql_connect()