-
Anonymous
Получение значения из ответа как функции
Сообщение
Anonymous »
Код: Выделить всё
$args = array(
'name' => 'test',
'description' => 'xxxx',
'start_time' => 'xxxx',
'end_time' => 'xxxxx'
);
$target_url = "https://graph.facebook.com/me/events";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$result = curl_exec($ch);
curl_close($ch);
Возвраты
Мне нужен этот идентификатор как $id в php, чтобы я мог использовать его и дальше.
спасибо.
Подробнее здесь:
https://stackoverflow.com/questions/136 ... a-function
1729518493
Anonymous
[code]$args = array(
'name' => 'test',
'description' => 'xxxx',
'start_time' => 'xxxx',
'end_time' => 'xxxxx'
);
$target_url = "https://graph.facebook.com/me/events";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
$result = curl_exec($ch);
curl_close($ch);
[/code]
Возвраты
[code] {"id":"xxxx"}
[/code]
Мне нужен этот идентификатор как $id в php, чтобы я мог использовать его и дальше.
спасибо.
Подробнее здесь: [url]https://stackoverflow.com/questions/13627741/getting-a-value-from-response-as-a-function[/url]