Jump to content

[SOLVED] implode function


timmah1

Recommended Posts

I'm setting up a newsletter system.

 

I have a form that selects everybody from the database and puts the users email address into a hidden field like so

<input type="hidden" name="user[]" value="<?=$row['email']; ?>" />

 

I'm testing to make sure it has all of the emails, when I click on the 'Submit' button, it should display every email that the newsletter is going to get sent to for testing purposes.

 

What happens is, it displaying every email 13 different times.

There are 128 different emails in the system, so logically it should only show 128 emails, but instead it's showing me 1,664 emails.

Here is the code:

$subscriber=$_POST['user'];

	$together = implode(", ", $subscriber);
	for($i = 0; $i < count($subscriber); $i++){

		echo "$together<br>";
	}

 

Can anybody tell me why it's showing every email multiple times, and not just once?

 

Thanks in advance

I

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.