Re: Fw: Re: [PHP] mail the contents of an array

From: Date: Fri, 03 Aug 2001 11:09:56 +0000
Subject: Re: Fw: Re: [PHP] mail the contents of an array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61118@lists.php.net to get a copy of this message
Ah, you didn't say you had 2-D arrays initially. Something along the lines of: $msg = ""; while (list(,$row) = each($myArray)) { $msg .= implode("\n", $row); } might work. - Tim On 03 Aug 2001 10:48:58 +0000, Geoffrey Makstutis wrote: > My problem problem is that I have 2-dimensional arrays, so I don't see how I can > concatenate them using: > > $msg = implode($array1, "\n") . implode($array2, "\n"); > > I can implode using: > > $count = count($item); > $x=0; > while ($x<$count){ > $pieces = implode(" - ", $item[$x]); > $x++; > } > > But then I've still got to step through $pieces. > > Any ideas? > > > Tim (infoz@earthlink.net) wrote: > > > >$msg = implode($array1, "\n") . implode($array2, "\n"); > >On 03 Aug 2001 10:04:23 +0000, Geoffrey Makstutis wrote: > >> I can get the strings via implode(), but then how do I concatenate them? > >> > >> Thanks > >> > >> Tim (infoz@earthlink.net) wrote: > >> > > >> >You could use the implode() function to convert the arrays to strings > >> >and then pass the concatenated strings to the mail() function. > >> > > >> >- Tim > >> > > >> >On 03 Aug 2001 09:00:04 +0000, Geoffrey Makstutis wrote: > >> >> I'm sure that I'm missing something obvious (probably sleep), but > >> >> how can I > take > >> the contents of several arrays and send them via email? I'd like to take each > value > >> from the arrays and include them in the message portion of a mail() command. > >> > > >> > > >> > > >> > > >> > > >> > >> -- > >> Geoffrey Makstutis > >> <gmak@51pct.com> > >> > >> 51% Studios > >> Architecture + Design > >> 1-5 Clerkenwell Road > >> London EC1M 5PA > >> > >> www.51pct.com > > -- > Geoffrey Makstutis > <gmak@51pct.com> > > 51% Studios > Architecture + Design > 1-5 Clerkenwell Road > London EC1M 5PA > > www.51pct.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#61118) next »