@שמואל-ש כתב בבהרצת קישור בPHP ע"י file_get_contents עם תווים בעברית, התווים נהיים ג'יבריש:
דהיינו?
function callGoogleAPI($url, $query){
if(!is_array($query))return false;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($query));
// Receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($http_code != 200) return( ['status' => false, 'answer' => $http_code ] );
curl_close ($ch);
return( ['status' => true, 'answer' => $server_output;] );
}
$url = 'https://script.google.com/macros/s/AKfycbwO5ZjANufUiWfAsijJhinMewr-Z1Blquzh4DtCawM1cjGDeHTaQio0gAGIU7WcKms5ww/exec';
$query = [
'name' => $name,
'subject' => $subject,
'body' => $body,
'filing' => $filing,
'recipient' => $recipient
];
$call_api = callGoogleAPI( $url, $query );
var_dump( $call_api );