what are Implode and Explode functions?

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


Please Help Members By Posting Answers For Below Questions

Can we learn php without html?

523


Explain the three different kinds of Arrays?

620


What is the difference between null and empty?

549


What is default session time and path in PHP. How to change it?

519


What is isset php?

497






How can I find my php version?

520


What is the best website to learn php?

505


What is the default session out time?

527


Which operator is used to concatenate two strings in PHP?

520


Can we override static method in php?

514


How failures in execution are handled with include() and require() functions?

561


Which is better php or wordpress?

499


Do you know what are traits?

512


How to remove leading and trailing spaces from user input values in php?

518


Php program to generate fibonacci series?

527