网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站设计 > PHP
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 49.87.40.35
Old 2015-01-08, 09:33 PM
Raquel Raquel is offline
初级会员
 
Join Date: 2011-06-02
Posts: 1
Raquel 现在声名狼藉
Default Php获取当前文件路径,上层目录路径

的現在檔案、目錄、上層目錄
於 test.php 內, 要做取得路徑、目錄等, 可見下述:
取得 路徑 + 檔名 (要取得 /var/www/project/test.php)
* echo __FILE__;
取得 檔名 (要取得 test.php)
* echo basename(__FILE__);
取得 不含附檔名的檔名 (要取得 test)
* echo basename(__FILE__, '.php');
取得 到此目錄前的完整 PATH, 不含檔名 (要取得 /var/www/project)
* echo dirname(__FILE__);
取得 到上層目錄前的完整 PATH (要取得 /var/www)
* echo dirname(dirname(__FILE__));
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 10:50 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.