PHP Functions
- Which one of the following functions can be used to compress a string?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
We will be able to achieve almost 50% size reduction using this function. The gzuncompress() function is used to uncompress the string.
- What will be the output of the following PHP code?
<?php
echo chr(55);
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The chr() function returns a character from the specified ASCII value. Since the ASCII value of 7 is 55, thus 7 was displayed.
- What will be the output of the following PHP code?
<?php
echo ord ("Ajit");
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
The ord() function returns the ASCII value of the first character of a string. The ASCII value of A is 65, thus 65 was displayed.
- What will be the output of the following PHP code?
<?php
$string = "keep practicing at interviewmania";
echo wordwrap($string, 15, "\n");
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The wordwrap() function wraps a string into new lines when it reaches a specific length.
- What will be the output of the following PHP code?
<?php
echo ucwords("i love interview mania!");
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
The ucwords() function converts the first character of each word in a string to uppercase.