문제

나는 userid를 ustousids 대신 iploding 마일입니다.

<?PHP
$users_in_range = users_in_range($lat, $long, 500, true); 

// implode users into mysql friendly list
$comma_separated = implode(",", $users_in_range);
echo $comma_separated;

// this is just for output while debugging
foreach ($users_in_range as $userid => $miles_away) {
    echo "UserID=<b>$userid</b> is <b>$miles_away</b> miles away from me.<br />";
}
?>
도움이 되었습니까?

해결책

userID는 배열의 키이므로 다음을 수행해야합니다.

$comma_separated = implode(",", array_keys($users_in_range));

다른 팁

노력하다 :

$comma_separated = implode(',', array_keys($users_in_range));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top