Q. What is the complete syntax of chunk_split() function in PHP?

  • (A) chunk_split(string,length,end)
  • (B) chunk_split(string)
  • (C) chunk_split(string,end)
  • (D) chunk_split(length)
πŸ’¬ Discuss
βœ… Correct Answer: (A) chunk_split(string,length,end)

Q. Which function is used to convert hexadecimal values to the ASCII characters?

  • (A) hex2bin()
  • (B) hex2str()
  • (C) hex2asc()
  • (D) hex_string()
πŸ’¬ Discuss
βœ… Correct Answer: (A) hex2bin()

Q. What is the complete syntax of join() function in PHP?

  • (A) join(string1, string2)
  • (B) join(string1, string2, separator)
  • (C) join(separator, array)
  • (D) join(separator, string1, string2)
πŸ’¬ Discuss
βœ… Correct Answer: (C) join(separator, array)

Q. There are two strings (in an array) "Hello" and "World", which is the correct PHP statement to join them with the separator ","?

  • (A) join(",","Hello","World")
  • (B) join("Hello","World",",")
  • (C) join(",", ("Hello","World"))
  • (D) join(",",array("Hello","World"))
πŸ’¬ Discuss
βœ… Correct Answer: (D) join(",",array("Hello","World"))

Q. Which PHP function is used to print (output) a formatted string?

  • (A) echo()
  • (B) print()
  • (C) printf()
  • (D) prints()
πŸ’¬ Discuss
βœ… Correct Answer: (C) printf()

Q. What will be the output of the following PHP code?

Code:
<?php
printf("%x",65535);
?> 
  • (A) ffff
  • (B) 0xffff
  • (C) FFFF
  • (D) 0XFFFF
πŸ’¬ Discuss
βœ… Correct Answer: (A) ffff

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

  • (A) strlength()
  • (B) strlen()
  • (C) length()
  • (D) str_len()
πŸ’¬ Discuss
βœ… Correct Answer: (C) length()

Q. What will be the output of the following PHP code?

Code:
<?php
echo ucwords("hi, there how are you?");
?>  
  • (A) Hi, there how are you?
  • (B) Hi, There How Are You?
  • (C) hi, there how are you?
  • (D) HI, THERE HOW ARE YOU?
πŸ’¬ Discuss
βœ… Correct Answer: (B) Hi, There How Are You?

Q. Which PHP functions are used to convert string to lowercase and uppercase?

  • (A) strupper() and strlower()
  • (B) str_toupper() and str_tolower()
  • (C) toupper() and tolower()
  • (D) strtoupper() and strtolower()
πŸ’¬ Discuss
βœ… Correct Answer: (D) strtoupper() and strtolower()

Q. Which PHP constant returns the largest integer supported?

  • (A) INT_MAX
  • (B) MAX_INT
  • (C) MAXINT
  • (D) PHP_INT_MAX
πŸ’¬ Discuss
βœ… Correct Answer: (D) PHP_INT_MAX