Better:
$resultstr = array();
foreach ($results as $result) {
$resultstr[] = $result->name;
}
echo implode(",",$resultstr);
More Related Contents:
- Split a comma-delimited string into an array?
- Return single column from a multi-dimensional array
- How to create an array from a CSV file using PHP and the fgetcsv function
- Convert array into csv
- Convert array of single-element arrays to one a dimensional array
- How to access mysql result set data with a foreach loop
- Restructure multidimensional array of column data into multidimensional array of row data [duplicate]
- Implode a column of values from a two dimensional array [duplicate]
- Convert array of single-element arrays to a one-dimensional array
- php implode (101) with quotes
- CSV to Associative Array
- Check if a specific value exists at a specific key in any subarray of a multidimensional array
- Generate an associative array from an array of rows using one column as keys and another column as values
- How to check if a specific value exists at a specific key in any subarray of a multidimensional array?
- Process CSV Into Array With Column Headings For Key
- Isolate comma-separated values, remove duplicates and empty values, then sort
- how can I print multiple services in this way
- Prevent creating duplicate entries in PHP
- PHP Sort a multidimensional array by element containing Y-m-d H:i:s date
- How to bind mysqli bind_param arguments dynamically in PHP?
- php multi-dimensional array remove duplicate [duplicate]
- How is the PHP array implemented on the C level?
- PHP – Merging two arrays into one array (also Remove Duplicates)
- Convert flat array to a delimited string to be saved in the database
- Group array data on one column and sum data from another column
- Merge row data from multiple arrays
- Reverse array in php
- How does array_diff work?
- Array size limit in PHP
- How are associative arrays implemented in PHP?