what are Implode and Explode functions?

Answer Posted / inno dev

explode= convert string into an array
such as
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0];
echo $pieces[1];
echo $pieces[2];
echo $pieces[3];
echo $pieces[4];
echo $pieces[5];

Implode=Join array elements with a string
means convert array into a string

such as
<?php

$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);

echo $comma_separated;
?>

Is This Answer Correct ?    22 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to display a table of any given number?

492


Explain what are psrs? Choose 1 and briefly describe it?

509


How to fix "headers already sent" error in php

542


Name some of the constants in php and their purpose.

533


How to strip whitespace (or other characters) from the beginning and end of a string?

468






What is full form of PHP?

609


What is isset php?

521


Does empty check for null?

540


How to remove an empty directory?

575


What does odbc do in context with php?

571


What is the difference between exception::getmessage and exception::getline?

531


Can a trait extend a class php?

513


Tell me what is the default session time in php?

543


What is the purpose of basename() function in PHP?

600


What is php ci?

550