[FX.php List] Seperating by comm instead of new line

william.downs william.downs at gmail.com
Sun Jul 20 06:14:38 MDT 2008


ggt !

Your a man of few words, but these words are gold !

Many thanks indeed - I actually have used this before - but lost it  
somehow

William

On 20 Jul 2008, at 12:17, Gjermund Gusland Thorsen wrote:
> My last post will fail, this should work
> ---
> foreach( $allNamesResult[ 'data' ] as $key => $allNamesData ) {
> 	$names[] = explode( ',', $allNamesData['task'][0] );
>
> 	foreach( $names as $v ) {
> 		echo $v . "\n";
> 	}
> }
> ---
> ggt
>
> 2008/7/20 Gjermund Gusland Thorsen <ggt667 at gmail.com>:
>> foreach( $allNamesResult[ 'data' ] as $key => $allNamesData ) {
>> $names[] = explode( ',', $allNamesData['task'][0] );
>> }
>>
>> foreach( $names as $v ) {
>> echo $v;
>> }
>> 2008/7/20 william.downs <william.downs at gmail.com>:
>>> Hi There,
>>>
>>> I am trying to do something so very simple - yet am having  
>>> problems with.
>>> Looked in all my PHP books, but can't work it out.
>>>
>>> I  need to extract the contents of one field, separated by a  
>>> comma, instead
>>> of being on a new line.
>>>
>>> foreach( $allNamesResult[ 'data' ] as $key => $allNamesData )
>>> {
>>> $name = $allNamesData['task'][0];
>>> echo $name
>>> }
>>>
>>> This will give me :
>>>
>>> John
>>> Richard
>>> Brian
>>>
>>> I want John, Richard, Brian
>>>
>>> Can someone please tell me what to do ? And then smack me on the  
>>> head ?
>>>
>>> Many thanks in Advance,
>>>
>>> William
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list