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

What is the difference between session_unregister() and session_unset()?

577


I need to know about the courses which are useful in corporate companies.. especially php/mySQL, Java/j2ee, .NET.. also tell if any other courses are valuable

1519


Write a program in php to reverse a number?

546


In PHP, fgets() is used to read a file one line at a time. State Whether True or False?

585


What is http get and post?

535






How can we submit a form without using submit buttons?

535


What is form validation in php?

527


What are major variables in research?

541


What is the use of ajax in php?

514


How do I make a reset button in html?

519


Explain the changes in php versions?

538


How to remove white spaces from the beginning and/or the end of a string in php?

542


What are the four scalar types of php?

621


in PHP for pdf which library used?

560


How to execute an sql query? How to fetch its result?

578