PHP Strings
- What will be the output of the following PHP code?
<?php
$Message = "this is important message...";
echo ucwords($Message);
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The ucwords() function capitalizes the first letter of each word in a string. Its prototype follows: string ucwords(string str).
- Which one of the following functions can be used to concatenate array elements to form a single delimited string?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
implode()
- Which one of the following functions finds the last occurrence of a string, returning its numerical position?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
strrpos()
- What will be the output of the following PHP code?
<?php
$contact = "inter0view@mania.com";
$contact = str_replace("0","@",$contact);
echo "Contact to the Interview Mania web designer at $contact.";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The str_replace() function case sensitively replaces all instances of a string with another.