代码:
1. <?php 2. $path='C:\AppServ\www\Basic1\demo1.php'; 3. 4. /* echo '文件名:'.basename($path); 5. echo '<br/>'; 6. echo '目录名:'.dirname($path); */ 7. 8. $array_path = pathinfo($path); 9. echo $array_path['extension']; 10. echo '<br/>'; 11. echo $array_path['filename']; 12. echo '<br/>'; 13. echo $array_path['dirname']; 14. echo '<br/>'; 15. echo $array_path['basename']; 16. 17. 18. ?>