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

Write down the benefits of php7?

621


Why php is sometimes called as embedded scripting language?

476


What is the use of imagetypes() method?

526


How do I see how many pages per session in google analytics?

515


Do you know when sessions ends?

546






How to get ip address of clients machine?

553


Tell me how can we automatically escape incoming data?

494


How can we change the value of a constant?

529


How to get elements in reverse order of an array in php?

558


What is slim framework?

489


What are the rules for naming a php variable?

531


What is the use of header() function in php?

533


What are the Formatting and Printing Strings available in PHP?

573


Is rent a variable cost?

546


What's the difference between accessing a class method via -> and via ::?

517