Last active
August 18, 2020 07:38
-
-
Save httpspace/714f14c603358be5e445b93d6f0f6a6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$input = array( | |
"access_token" => 'token', | |
"message" => '文字', | |
'url' => '圖片網址, | |
'method' => 'photos' | |
); | |
postFb($input); | |
function postFb($id, $input){ | |
$method = $input['method']; | |
unset($input['method']); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/".$id."/{$method}"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $input); | |
$response = curl_exec($ch); | |
return $return_array = json_decode($response, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment