Questions And Answers

More Tutorials

Convert array of strings to List in PHP

string array to array in php

parse_str(unserialize($string_type_array), $array);

In this article, we are using two methods to convert array to string. Method 1: Using implode() function: The implode() method is an inbuilt function in PHP and is used to join the elements of an array. The implode() method is an alias for PHP | join() function and works exactly same as that of join() function.


// Declare an array
$arr = array("Welcome","to", "GeeksforGeeks",
	"A", "Computer","Science","Portal");
// Converting array elements into
// strings using implode function
echo implode(" ",$arr);



Welcome to GeeksforGeeks A Computer Science Portal


In this page (written and validated by ) you learned about . What's Next? If you are interested in completing PHP tutorial, we encourage you simply to start here: PHP Tutorial.

Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue:

Share On:

Mockstacks was launched to help beginners learn programming languages; the site is optimized with no Ads as, Ads might slow down the performance. We also don't track any personal information; we also don't collect any kind of data unless the user provided us a corrected information. Almost all examples have been tested. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. By using, you agree to have read and accepted our terms of use, cookies and privacy policy.