Php file operation problems & lt ;? Php $ path = & quot; D: \ Install -- Doucment \ wamp \ www \ a.txt & quot; echofilesize ($ path );? & Gt; & nbsp; the following error occurs in the total number of lines of code: Warning: filesi php file operation problem
$ Path = "D: \ Install -- Doucment \ wamp \ www \ a.txt ";
Echo filesize ($ path );
?>
The following error occurs in a total of these lines of code:
Warning: filesize () [function. filesize]: stat failed for D: \ Install -- Doucment \ wamp \ www \ a.txt in D: \ Install -- Doucment \ wamp \ www \ Practice. php on line 4
I cannot find a similar solution on the internet. I don't know which of the following heroes knows the solution... Thank you!
------ Solution --------------------
In PHP, use dirname (_ FILE _). the path should be a backslash (/) rather than a slash \
View http://php.net/manual/zh/function.dirname.php
------ Solution --------------------
There is no other reason for path error. if the file does not exist, this prompt will appear.
You can put the test file and a.txt together to avoid errors.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service