View Single Post
Old 08-24-2012, 04:02 AM   PM User | #4
Len Whistler
Senior Coder

 
Len Whistler's Avatar
 
Join Date: Jul 2002
Location: Vancouver, BC Canada
Posts: 1,323
Thanks: 26
Thanked 100 Times in 100 Posts
Len Whistler is on a distinguished road
MySQL can return unique records or you can get PHP to sort through the results, I think it's usually better to get MySQL to do most of the work.


PHP Code:
<?php

//0002 has three posts, 0764 has two posts.
$thread_posts_ids = array("0002","0024","0014","0002","0764","8888","0764","4321","0002","7632");
$thread_posts_unique_ids array_unique($thread_posts_ids);

foreach (
$thread_posts_unique_ids as $value){
echo 
"Send email to: $value<br>";
}
?>
Output
Code:
Send email to: 0002
Send email to: 0024
Send email to: 0014
Send email to: 0764
Send email to: 8888
Send email to: 4321
Send email to: 7632
__________________
Leonard Whistler

Last edited by Len Whistler; 08-24-2012 at 04:06 AM..
Len Whistler is offline   Reply With Quote