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

How To Get the Uploaded File Information in the Receiving Script?

589


What is beforeRender() used?

635


sort term descripttion form, report and uery

1657


What exactly is PHP?

610


How to split a string into array using php?

550






What is constructor and destructor?

532


Tell me what is the use of "ksort" in php?

556


Which is faster for or foreach php?

503


What is difference between base_url and site_url?

498


What’s the difference between htmlentities() and htmlspecialchars()?

577


Which is the latest version of php?

545


What does pear stand for?

537


Is php deprecated?

534


Does csrf token change?

524


What is if isset ($_ post submit )) in php?

542