Answer Posted / puneet bhatt
explode function:-it breaks a string into array.
<?php
$str="hello world.it's a beautiful day.":
print_r(explode(" ",$str):
?>
ans-ARRAY
[0]=>hello
[1]=>world.
[2]=>it's
[3]=>a
[4]=>beautiful
[5]=>day.
implode:-returns a string from elements of an array.
<?php
$arr=array('hello','world!',beautiful,'day!');
echo implode(" ",$arr);
?>
ans-hello world! beautiful day!
| Is This Answer Correct ? | 36 Yes | 5 No |
Post New Answer View All Answers
What is php explain how php works?
What is the role of the .htaccess file in php?
Can a trait extend a class php?
What software is required for php?
How to create a session? How to set a value in session? How to remove data from a session?
How to fix "headers already sent" error in php
What is difference between readonly and constant?
What is namespace in php?
What is mvc? Why its been used?
Is php front end?
With a heredoc syntax, do I get variable substitution inside the heredoc contents?
How do you destroy a session?
What was the old name of php?
Do while loops php?
What is the difference between characters 34 and x34?