Assign variable as array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wihvd
Forum Newbie
Posts: 6
Joined: Mon Mar 29, 2010 12:29 am

Assign variable as array

Post by wihvd »

Hello,

how can I send array in email? For example, I have function

Code: Select all

mail ($to, $subject, $body, $headers);
and I have mysql table:

Code: Select all

id         name          event
-------------------------------
1         name1         event1
2         name2         event2
3         name3         event3
When I send mail I want $body to look like this in recipients email:

name1
event1

name2
event2

name3
event3

How can I achieve it?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Assign variable as array

Post by requinix »

You use a loop to make what you want.
Post Reply