Код: Выделить всё
if (isset($_REQUEST['Receipts'])) {
$params['Date'] = '31 Jan 2000';
$response = $Auth->request('GET', $Auth->url('Receipts/Travel', 'core'), $params);
if ($Auth->response['code'] == 200) {
$receipt = $Auth->parseResponse($OAuth->response['response'], $Auth->response['format']);
pr($receipt->Receipts);
} else {
outputError($Auth);
}
}
Я новичок и поэтому попробовал следующий базовый цикл foreach, который не сработало, поскольку я знаю, что неправильно расставил логику.
Код: Выделить всё
if (isset($_REQUEST['Receipts'])) {
$months = array(" 31 Jan 2000"," 28 Feb 2000"," 31 Mar 2000","30 Apr 2000","31 May 2000","30 Jun 2000","31 Jul 2000"," 31 Aug 2000","30 Sep 2000","31 Oct 2000","30 Nov 2000","31 Dec 2000");
foreach ($months as $month){
$params['Date'] = '31 Jan 2000';
$response = $Auth->request('GET', $Auth->url('Receipts/Travel', 'core'), $params);
if ($Auth->response['code'] == 200) {
$receipt = $Auth->parseResponse($OAuth->response['response'], $Auth->response['format']);
pr($receipt->Receipts);
} else {
outputError($Auth);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/231 ... -in-a-year
Мобильная версия