Queries and SolutionsCategory: PHPexplode() and implode() function
Anita asked 5 years ago

What are the uses of explode() and implode() functions?

1 Answers
Prithvi answered 5 years ago

explode() function is used to split a string into an array
on the other hand
implode function is used to join elements of an array with a string.

Example:
$text = “PHP is a general purpose programming language”;
print_r (explode(” “,$text));
$strarr = array(‘Ram’,’Kumar’,’Sharma’);
echo implode(” “,$strarr);

Your Answer

5 + 15 =