例子<?php//獲得當前目錄echo getcwd();echo "<br />"; //改變為images 目錄chdir("images");echo "<br />";echo getcwd();?> 輸出:C:\testweb\mainC:\testweb\main\images