-1
액세스 토큰을 사용하여 여러 페이스 북 계정에 게시하려면 아래 코드를 얻으려고합니다. 액세스 토큰을 token.txt
파일에 저장하고 해당 token.txt
파일에서 액세스 토큰을 가져오고 있습니다. 여기 PHP 컬을 사용하여 Facebook 프로필에 게시 할 여러 토큰
$a = file_get_contents("token.txt");
$token = explode("\n",$a);
$data['message'] = "Hello Friends xoxo :)";
$data['access_token'] = $token;
$post_url = 'https://graph.facebook.com/me/feed';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $post_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($ch);
curl_close($ch);
위의 코드로부터의 출력이고 : 여기서
내 코드
PHP Notice: Array to string conversion in /home/masudtoo/public_html/mcteam/autopostfb.php on line 10
이것은 라인 (10)에 대한 코드는 다음
$fields_string .= $key . '=' . $value . '&';
코드 많은 문제가있다. 코드에 문제가 있으면 해결하도록 도와주세요. 감사. 코멘트에서
이 코드를 아직 실행 해 보셨습니까? 이 코드를 실행하여 생성 된 오류를 질문에 추가하십시오. 감사. – Gi0rgi0s
'PHP주의 사항 : /home/masudtoo/public_html/mcteam/autopostfb.php 온라인 10 행의 문자열 변환 및 코드 줄 10 :'$ fields_string. = $ key. '='. $ 값. '&'; ' –
추후에 감사합니다. – Gi0rgi0s