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

What is use of count() function in php?

562


Tell me what does $_env means?

528


What is the meaning of xdebug?

540


How do you end a function in python?

532


Why constructor is not overridden?

538






Is key in array php?

584


Why do we use php?

534


What is the delimiter default in PHP?

603


Is php procedural or oop?

550


What are php magic methods/functions?

555


Explain difference between urlencode and urldecode?

552


What is default session time and path in php?

541


What is the maximum size of a database in mysql?

523


How to find a specific value in an array?

502


What are the 3 types of sessions?

539