PHP Implode array elements
If you are having 1 dimension array and you would like to use this type of array in you mysql query
you can use the PHP implode function.
--------------------------------
Example Array
--------------------------------
echo "<pre>";
print_r($yearSearch);
Array
(
[0] =1979
[1] =1980
[2] =1981
[3] =1982
[4] =1983
[5] =1984
[6] =1985
[7] =1986
[8] =1987
[9] =1988
[10] =1989
[11] =1990
[12] =1991
[13] =1992
[14] =1993
)
--------------------------------
Example Implode
--------------------------------
echo $array = implode(",", $yearSearch);
About this entry
You’re currently reading “PHP Implode array elements,” an entry on Xyiry PHP Blog | Where Open Source Lives
- Published:
- 11.18.09 / 12pm
- Category:
- PHP
No comments
Jump to comment form | comments rss [?] | trackback uri [?]