0
PHP 코드에서 DateTime 객체에서 하루를 빼야합니다. 날짜가 같은 해에 있으면 실행되지만 1 년 째 날로부터 하루를 빼면 실행되지 않습니다.DateTime 객체에 일을 빼기
코드는 다음과 같다 :이 경우
$date = date_create('20180101');
$edition_date = $date->format('Ymd');
$edition=$date->format('Ymd').'piacenza';
$img_url = false;
$count = 0;
do {
++$count;
$url='http://www.url.it/url/webservice/getThumb.jsp?edition='.$edition.'&height=400&half=true';
$img_url = @imagecreatefromjpeg($url);
if (!$img_url) {
$edition_date = $edition_date - 1;
$edition = $edition_date.'piacenza';
}
} while (!$img_url && $count < 5);
, 계산 된 날짜는 20180096이며 uncorrect입니다.
제발 도와 주시겠습니까?
같은 것을보십시오! 많은 감사합니다! –