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

How we get ip address of client, previous reference page etc?

553


How to check your php installation?

502


What is the difference between single quoted string and double quoted string?

516


Tell me what is the difference between ereg_replace() and eregi_replace()?

539


What is in a cookie?

545






How do you measure variables?

513


Why does sql injection happen?

564


what the new feature add in php 7.2?

536


Is learning php easy?

524


Does php need to be installed?

496


Tell me how can we check the value of a given variable is alphanumeric?

493


What is difference between count or sizeof function in php?

528


How do I escape data before storing it in the database?

570


Tell me what sized websites have you worked on in the past?

496


What is cms php?

496