사이트 내 전체검색
PHP
basename()
로빈아빠
https://cmd.kr/php/362 URL이 복사되었습니다.

본문

string basename(string path, string suffix)

* path란 전체 파일의 전체 경로명을 인수로 받아 파일명만을 반환한다.

* suffix : 출력되는 파일명의 끝부분의 문자를 삽입시 생략이 된다.


<?php
$path 
"/home/httpd/html/index.php"
;
$file basename($path);         
// $file is set to "index.php"
$file basename($path".php"); 
// $file is set to "index"
?>

댓글목록

등록된 댓글이 없습니다.

PHP
871 (14/18P)

Search

Copyright © Cmd 명령어 3.143.241.159