Error: Client error: `GET https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=IGAAIbn3HQzhdBZAGJ1V21OQ1pSZAUpsZAXRRMzl1RWJxelVUY1JPdG4xU1hDR19udFZAxWmlVbzgxNElGSFNvWUY0VmNIbDd3ZAW55dm4xMWxQTmlrcXgzNFdfTy1MQ2JQbGs3Q3B2c0dyZAVNISEN3ZAkxabG9B` resulted in a `400 Bad Request` response: {"error":{"message":"Error validating access token: The session has been invalidated because the user changed their pass (truncated...) 특정 디렉토리에 모든 파일 삭제 또는 특정 디렉토리에 특정 확장자 파일만 삭제 > 정보공유 | 그누위즈 - 웹 사이트 제작 전문

특정 디렉토리에 모든 파일 삭제 또는 특정 디렉토리에 특정 확장자 파일만 삭제 > 정보공유

본문 바로가기

정보공유

일반글
PHP

특정 디렉토리에 모든 파일 삭제 또는 특정 디렉토리에 특정 확장자 파일만 삭제

페이지 정보

게시물QR코드

본문

<?php

// 특정디렉토리에 모든 파일 삭제

 

$directory = "/www/upload";

$handle = opendir($directory); // 절대경로

while ($file = readdir($handle)) {

        @unlink($directory.$file);

}

closedir($handle);

?>




<?php

// 특정 디렉토리에 특정 확장자만 삭제

 

$directory = "/www/upload";

$handle = opendir($directory); // 절대경로

while ($file = readdir($handle)) {

    $fileInfo = pathinfo($file);

    $fileExt = $fileInfo['extension']; // 파일의 확장자를 구함

    if($fileExt == "jpg") {

        @unlink($directory.$file);

    }

}

closedir($handle);

?>


댓글목록

등록된 댓글이 없습니다.

  • Addr.부산광역시 동래구 명장로106번길 70-4, 301호 CEO. 이경애 Email. gnuwiz@naver.com
  • BR. 625-68-00172 TRC. 2024-부산진-0560 TEL. 0507-1382-2790
Copyright © 2017 ~ 그누위즈. All rights reserved.