php disk_total_space

后端 未结 5 1367
后悔当初
后悔当初 2021-01-21 11:04

i need help with disk_total_space function..

i have this on my code



        
5条回答
  •  孤城傲影
    2021-01-21 11:25

    I think that method will only tell you information about the filesystem or partition the given directory is on. You could try simply shelling out to du though:

    $space_used=`du -sh $dir`;
    

    -s summarizes the entire dir, -h returns the result in "human" units like MB and GB.

    Edit: apologies, I missed that this was on WIndows. WIll leave the answer in case it helps someone searching for a similar problem. For windows, try this suggestion in the PHP manual

提交回复
热议问题