라이브러리

[PHP] restore_include_path - include_path 구성 옵션의 값을 복원합니다.




PHP 에서 `restore_include_path` 함수는 include_path 설정을 이전 상태로 복원하는 함수입니다. include_path 설정은 PHP가 파일을 포함할 때 사용하는 경로를 지정하는 설정입니다.

include_path 설정


include_path 설정은 PHP.ini 파일이나 `ini_set` 함수를 사용하여 설정할 수 있습니다. 예를 들어, 다음 코드는 include_path 설정을 `/var/www/html` 경로로 설정합니다.

#hostingforum.kr
php

ini_set('include_path', '/var/www/html');



restore_include_path 함수


`restore_include_path` 함수는 include_path 설정을 이전 상태로 복원합니다. 이 함수를 사용하여 include_path 설정을 원래 상태로 되돌릴 수 있습니다.

#hostingforum.kr
php

restore_include_path();



예제


다음 예제는 include_path 설정을 변경하고, `restore_include_path` 함수를 사용하여 이전 상태로 복원하는 코드입니다.

#hostingforum.kr
php

// include_path 설정을 변경합니다.

ini_set('include_path', '/var/www/html');



// 현재 include_path 설정을 출력합니다.

echo "현재 include_path 설정: " . get_include_path() . "
";



// include_path 설정을 변경합니다.

ini_set('include_path', '/var/www/html/new');



// 현재 include_path 설정을 출력합니다.

echo "현재 include_path 설정: " . get_include_path() . "
";



// restore_include_path 함수를 사용하여 이전 상태로 복원합니다.

restore_include_path();



// 현재 include_path 설정을 출력합니다.

echo "현재 include_path 설정: " . get_include_path() . "
";



이 예제에서, `ini_set` 함수를 사용하여 include_path 설정을 `/var/www/html`와 `/var/www/html/new`로 변경합니다. `get_include_path` 함수를 사용하여 현재 include_path 설정을 출력합니다. `restore_include_path` 함수를 사용하여 이전 상태로 복원합니다.

결과


이 예제의 결과는 다음과 같습니다.

#hostingforum.kr


현재 include_path 설정: /var/www/html

현재 include_path 설정: /var/www/html/new

현재 include_path 설정: /var/www/html



이 예제에서, `restore_include_path` 함수를 사용하여 include_path 설정을 이전 상태로 복원했습니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 10,077건 / 273 페이지

검색

게시물 검색