Re: [請益] plurk-php-api 回覆編碼問題
小弟的程式碼
<?php
$checkrepo=0;
$zodiac = array(
'123',
);
$api_key = 'xxx';
$username = 'xxxx';
$password = 'xxxx';
require('plurk_api.php');
$plurk = new plurk_api();
$plurk->login($api_key, $username, $password);
$Plurks = $plurk->get_plurks(NULL, 30, NULL, NULL, NULL);
$filter_qualifier = 'asks';
$response_qualifier = 'says';
foreach($Plurks->plurks as $key => $msg){
$check_str = trim($Plurks->plurks[$key]->content_raw);
if(mb_strlen($check_str, 'UTF-8') != 3) continue;
$Re = $plurk->get_responses($Plurks->plurks[$key]->plurk_id);
foreach($Re->friends as $rekey => $remsg){
if($rekey=='3670803'){
$checkrepo = '1';
}
}
if($checkrepo!='1'){
if(in_array($check_str, $zodiac)){
$target_pid = $Plurks->plurks[$key]->plurk_id;
$target_time = strtotime($Plurks->plurks[$key]->posted);
$response = '早安';
$result = $plurk->add_response($target_pid, $response,'says');
}
}
}
?>
目前試過urlencode和mb_convert_encoding但都沒效果orz
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 112.104.69.140
討論串 (同標題文章)
完整討論串 (本文為第 3 之 3 篇):
PHP 近期熱門文章
PTT數位生活區 即時熱門文章