function s_weibo_detail_by_mid($mid, $key = false) { if (is_string($mid)) { //查一个 $mid = array($mid); } else { if (is_array($mid)) { //查多个 if (is_string($key)) { //是一个联合数组,那么按$key取值 $list = $mid; $mid = array(); foreach ($list as $item) { if (!s_bad_string($item[$key], $id)) { $mid[] = $id; } } unset($list); } } } if (s_bad_array($mid) || false == ($data = s_weibo_2id_by_mids($mid))) { return false; } //查询所有的微博详情 $list = array(); foreach ($data as $key => $wid) { $list[$key] = s_weibo_by_wid($wid); } return $list; }
$data = s_user_by_uid($token); } else { if (!s_bad_string($token)) { echo 'null'; //是字符,当username $data = s_user_by_nickname($token); } } } else { if ($type === 'getWeiboDetail') { if (s_bad_post('token', $token)) { return s_action_error('require params: wid.'); } if (!s_bad_id($token)) { //是数字,当WID $data = s_weibo_by_wid($token); } else { if (!s_bad_string($token)) { //是BASE64,当mid $data = s_weibo_by_mid($token); } } } } for ($i = 0; $i < 10; ++$i) { $weibo = "测试p/s, from ab, at:" . time() . " " . rand(1, 100000); s_user_post($weibo); $weibo = "测试p/s, from ab, at:" . time() . " " . rand(1, 100000); s_user_post($weibo); $weibo = "测试p/s, from ab, at:" . time() . " " . rand(1, 100000); s_user_post($weibo);