PHP Functions
- What will be the output of the following PHP code?
<?php
echo lcfirst("HELLO FRIENDS");
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The lcfirst() function converts the first character of a string to lowercase.
- What will be the output of the following PHP code?
<?php
echo hex2bin("496e74657276696577204d616e6961");
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The hex2bin() function converts a string of hexadecimal values to ASCII characters.
- What will be the output of the following PHP code?
<?php
$string = addslashes('how are "you" doing?');
echo $string;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
The addslashes() function returns a string with backslashes in front of predefined characters.
- What will be the output of the following PHP code?
<?php
$string = "Hello Interview Mania. It's a knowledgeable website.";
print_r (explode(" ",$string));
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The explode() function breaks a string into an array.
- What will be the output of the following PHP code?
<?php
echo strtr("Hilla Interview Mania","ia","eo");
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
The strtr() function translates certain characters in a string.