What will be the output of the following PHP code?
<?php
$text = “this is\tsome text that\nwe might like to parse.”;
print_r(split(“[\n\t]”,$text));
?>
a) this is some text that we might like to parse.
b) Array ( [0] => some text that [1] => we might like to parse. )
c) Array ( [0] => this is [1] => some text that [2] => we might like to parse. )
d) [0] => this is [1] => some text that [2] => we might like to parse.
Answer: d
Explanation: The split() function divides a string into various elements, with the boundaries of each element based on the occurrence of a defined pattern within the string.
Related Posts
In which authentication method does changing the username or password can be done only by entering the code and making the manual adjustment.
Which of the following are types of PHP authentication implementation methodologies?
i) Hard-coding a login pair directly into the script
ii) File-based authentication
iii) Data-based authentication
iv) PEAR’S HTTP authenticationWhich function is used to verify whether a variable contains a value?
Which of the following PHP function is commonly used when handling authentication via PHP?
i) header()
ii) footer()
iii) inset()
iv) isset()Which of the following variables does PHP use to authenticate a user?
i) $_SERVER[‘PHP_AUTH_USER’].
ii) $_SERVER[‘PHP_AUTH_USERS’].
iii) $_SERVER[‘PHP_AUTH_PU’].
iv) $_SERVER[‘PHP_AUTH_PW’].How many predefined variables does PHP use to authenticate a user?
How many validation filters like FILTER_VALIDATE_EMAIL are currently available?
Join The Discussion