English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP String String Function Manual
The implode() function is used to return a string composed of array elements.
string implode ( array $pieces )
It is used to concatenate array elements with a string
It returns a string that contains the string representation of all array elements in the same order.
Number | Parameters and Description |
---|---|
1 | glue Default is an empty string. |
2 | pieces The array you want to convert. |
Try the following example to combine array elements into a string
<?php //Combine Array Elements into a String $a1 = array("1","2","3"); $a2 = array("a"); $a3 = array(); echo ''1 is: ''".implode('','",$a1)."'<br>"; echo ''2 is: ''".implode('','",$a2)."'<br>"; echo ''3 is: ''".implode('','",$a3)."'<br>"; ?>Test and See‹/›
Output Result-
a1 is: ''1','2','3' a2 is: ''a'' a3 is: ''