Thứ Hai, 15 tháng 4, 2013

Hàm basename() - Lấy tên tệp tin hay đường dẫn tương đối

Ví dụ:
 
<?php
$path
= "/some/long/path/to/the/special_file.txt"; $filename1 = basename($path); // Hiện tên tập tin special_file.txt $filename2 = basename($path, ".txt"); // Thì chỉ lấy special_file?>

Không có nhận xét nào:

Đăng nhận xét