| | |
Array to String
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
For a one dimensional array, use the implode() function:
[php]
$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);
echo $comma_separated; // lastname,email,phone
[/php]
[php]
$array = array('lastname', 'email', 'phone');
$comma_separated = implode(",", $array);
echo $comma_separated; // lastname,email,phone
[/php]
Check out my blog at http://www.shinylight.com for more stuff about web dev.
![]() |
Similar Threads
- Dynamic Array Using String Class (C++)
- Value of type 'String' cannot be converted to '1-dimensional array of String'? (VB.NET)
- How can i write program that writes into a file from an array of string and reverse (C++)
- Converting byte array into string (ASP.NET)
- Help picking numbers out of an array/string (C++)
- Conversion of Long Array to String (Java)
- Array/String intersect and Array/Array intersect code (C#)
- Conver int Array into a String (Java)
Other Threads in the PHP Forum
- Previous Thread: how can i used session and cookies ???
- Next Thread: PHP 5 fast&easy web development
| Thread Tools | Search this Thread |
301 access apache api array autocomplete beginner binary broken button cakephp checkbox class cms code compression cron curl data database date display dropdown dropdownlist duplicates dynamic echo email error execution file files folder form forms function functions google href htaccess html htmlspecialchars httppost image include insert integration ip javascript joomla jquery limit link links login mail md5 menu methods mlm multiple mysql oop paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote script search secure server session sessions sms source space sql subscription syntax system table tutorial update upload url validator variable video virus volume votedown web youtube






