what are Implode and Explode functions?

Answer Posted / jhon

Implode and Explode are function sthat are opposite in working
Explode converts a string into array where as implode
coverts an array in string
explode example

<?php
$str = "test explode in php";
print_r (explode(" ",$str));
?>
output will be:
Array
(
[0] => test
[1] => explode
[2] => in
[3] => php
)
implode example


<?php
$arr = array('hi','hello');
echo implode(" ",$arr);
?>
output will be:
hi hello

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is chrome logger?

556


Which function will suitably replace 'x' if the size of a file needs to be checked? $Size=x(filename);

547


What is the method to execute a php script from the command line?

554


What is the current stable version of php? What advance thing in php7?

514


Is empty java?

533






What is __ construct in php?

539


what is difference between PHP4 , PHP5

1894


Does wordpress still use php?

520


What is string in php?

560


What does $globals mean?

522


What are the ways to include file in php?

524


Does php class need constructor?

481


How stop the execution of a php scrip?

529


Is age interval or ordinal data?

517


Is there an easy way to delete an element from a php array?

475