PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

PHP Questions Forums : PHP Questions and Answers

Jump to Last Post

Turning an array into a string

By: Timjohns [15-February-10 3:12PM]
25 posts
picture

There are a couple of ways of turning arrays into strings in PHP.

The key is to pass the delimiter that you want to use to implode from the array to the string.

You can use join or you can use implode.

For most instances implode is all you will need.

Just do it like this:
$mystring = implode(",",$myarray);

that will then create a string of the members of $myarray separated by a comma.

Previous: Sending Text Messages With PHP
Next: Custom Sorting Arrays In PHP



Custom Search