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

Tell me which function gives us the number of affected entries by a query?

519


What is php and features of php?

447


How can you send email in php?

547


How to replace a substring in a given string in php?

549


What are magic constants in php?

563






Is php harder than javascript?

428


How do we get the current session id?

552


Should I learn php before wordpress?

495


Why print_r is used in php?

535


What is session and why do we use it?

552


Tell me when a conditional statement is ended with an endif?

498


When viewing an html page in a browser, the browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?

547


What is the current stable version of php?

547


Tell me what is htaccess?

488


How to remove blank spaces from the string?

532