[eluser]tim1965[/eluser]
No i hadn“t sorry. I couldt use the example as ti stood in a foreach loop. Because of the complexities of the returned data and the fact that i only needed to apply this to certain fields. Funnily enough i had just got to array_filter on another forum.
So my example now looks like
$data=$this->M_model->return_query_details();
$array = array (
$array[0] = $data['test1'],
$array[1] = $data['test2'],
$arrayy[2] = $data['test3'],
);
$data['view'] = implode(", ", $array);
In this example, would it be better to filter $data or filter $array to strip out the null values. As i said above my actual code will run thru this a number of times for each of the field groups i need to apply this formatting to. I have to create $array this way, to take account of the different returned result sets from the query.
I hope this maes sense!
This seems like a lot of effort to put a comma at the end of a word to make it look pretty.
Thanks again for all you r help so far.