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
Explain why would we use === instead of ==?
What's the best method for sanitizing user input with php?
How to enable error reporting in php?
Do you know is it possible to extend the execution time of a php script?
Is key in array php?
Which method do you follow to get a record from a million records? (Searching not from database, from an array in php)?
What are the ways to include file in php?
What does $globals mean?
What is php and why it is used?
Where sessions stored in PHP?
Should I use mysqli or pdo?
How the web server interprets php and interacts with the client?
What is array filter php?
How to call php function from javascript using ajax?
How to stop the execution of php script?