Contact me See Resume

Array to string conversion using implode function -

Array to string conversion using implode function

Catagory : PHP and mySQLi Posted : February, 11, 2019

In this tutorial we will discuss about PHP default function called implode. We can easily make an array to string conversion using implode function.


Returns string from an array elements (values);

The implode() function is very useful in SELECT query in mysqli.


The implode function takes two arguments. First is separator in sting form and second is elements (values) of array.

The default separator is blank (empty string).

For details Please refer


Lest create an array with two elements and take output.

$str = ["PHP is a programming language.", "PHP is used for Web programming."];

echo $str = implode(" ", $str)."<br>";

Here I am using ” ” blank space to join to string. So result will in continuous paragraph.

Result :

PHP is a programming language. PHP is used for Web programming.

Leave a Reply

You have to agree to the comment policy.