To join an array of characters into a string in PHP, you can use the implode()
function.
The implode()
function takes two parameters:
Here's an example:
main.php82 chars4 lines
This will output:
main.php6 chars2 lines
In the example above, we used an empty string as the separator, but you can use any string you want to separate the elements. If the separator string is not provided, the default separator is an empty string.
gistlibby LogSnag