How to convert an array to a string with PHP?

Spread the love

Sometimes, we want to convert an array to a string with PHP.

In this article, we’ll look at how to convert an array to a string with PHP.

How to convert an array to a string with PHP?

To convert an array to a string with PHP, we can use the implode function.

For instance, we write

$s = implode("|", $type);

to call implode with '|' and $type to return a string that has the entries in $type joined together with '|'.

Conclusion

To convert an array to a string with PHP, we can use the implode function.

Leave a Reply

Your email address will not be published. Required fields are marked *