what are Implode and Explode functions?

Answer Posted / kalaimani.k mca (gurunanak col

Example . explode()

<?php
$history= "php4 php5 php6";
$pieces = explode(" ", $history);

//separated the arrays

echo $history[0]; // php3
echo $history[1]; // php4
echo $history[1]; // php5
?>

//implode Join array elements with a string

implode() example
<?php
$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);
echo $comma_separated;

//lastname,email,phone

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between unlink() and unset()?

522


How can you encrypt password using php?

506


Explain what is the difference between session and cookie?

530


What is a comment in php?

616


What is difference between mysql_fetch_array and mysql_fetch_assoc?

487






What are php filters?

506


Where php language is used?

518


What is json php?

519


Which is better #define or enum?

520


What is php stack?

514


How could I install codeignitor ?

1726


How do you check is php not empty?

541


What is active record in php?

470


Is php closing tag necessary?

542


How can MYSQL functions be available with PHP?

543