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

Why super () is used in java?

521


Is php dead 2019?

536


How to track user logged out or not? When user is idle?

505


How to invoke a user function?

542


Tell me how can we determine whether a variable is set?

499






Can we run php on tomcat server?

550


Write a select query that will be displayed the duplicated site name and how many times it is duplicated?

565


What is uri routing?

517


How is the comparison of objects done in php?

514


What are php libraries?

488


Is overloading possible in php?

509


Can we override magic methods in php?

530


What is json php?

523


What is the difference between super () and this ()?

541


Explain what does $_server means?

567