English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The implode() function is used to return a string composed of array elements.
string implode ( array $pieces )
It is used to concatenate array elements through string connection
It returns a string that contains the string representation of all array elements in the same order.
Serial number | Parameters and descriptions |
---|---|
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 "a1 is: '".implode("','",$a1)."'<br>"; echo "a2 is: '".implode("','",$a2)."'<br>"; echo "a3 is: '".implode("','",$a3)."'<br>"; ?>test see </›
output result-
a1 is: ''1','2','3' a2 is: 'a' a3 is: ''