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

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

How do I turn an array into a string?


If you explode to go one way, then you implode to come back the other way (or use join if you want to type less characters).

Just use the delimiter as the first argument and the array as the second.

Here we go:

<?php
$myarray 
= array("I","love","washing","up");
$mystring implode(" "$myarray);
echo 
"$mystring";//I love washing up
?>



ASK A QUESTION

More arrays PHP Questions

OK I've been trying to echo out the arrays "$people and $other people" using the for-each method in alphabetical order. but when i see what this displays it does it in some other order. THIS IS THE CODE PHP Ch8 Lab

reverse an array

im getting a Resource id #5 $rs_comp = mysql_query("select * from company where autoID='$row_settings[compid]'");

How do I sort the members of an array by value?

How do I reverse sort an array by key?



Custom Search