Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jlewis2k1

macrumors 6502a
Original poster
Jan 14, 2005
718
0
in your closet
In my SQL database I have a field that has a value as:
Code:
1000, 1013

This is the code I have:
PHP:
function SentTo($list)
{
	$arr = array($list);
	while (list($value) = each($arr))
	{
		$who=GetUIDMessages($value);
		echo $who;
		echo "<br>";
	}

}

What I want to do is some how get the small list of IDs to return it's real name.

So, for an example, if someone sends a message to 3 people and in that field it will show: 1012, 1010, 1002 and when you view the message i want to be able to return the actual name of the IDs that were inserted. To do this I have a small function that takes that list (shown above) and request the names of the IDs using GetUIDMessages($value) function. Is there a way to do this? Thanks for your help in an advance!
 
See if this gets you what you want.
PHP:
function SentTo($list)
{
    $arr = preg_split('/[\s,]+/', $list);
    for ($a=0; $a < count($arr); $a++)
    {
        $who=GetUIDMessages($arr[$a]);
        echo $who;
        echo "<br>";
    }
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.