Php accessing network shared resources and local files _ PHP Tutorial

Source: Internet
Author: User
Php accesses network shared resources and local files. [Php] metahttp-equivContent-Typecontenttexthtml; charsetGBK? Php $ filenameD: pic_gatherfigure1.png; $ sizefilesize ($ filename); echo $ size ;? My company has no access to the Internet, but my job [php]

$ Filename = "D:/pic_gather/figure/1.png ";
$ Size = filesize ($ filename );
Echo $ size;

?>

The company has no access to the Internet, but my work needs to be on the Internet, so I can only use the company's public computer. Use your computer to remotely operate on him (in fact, you can get proxy, but this method is not used ). So some files are on the public machine, but I am too lazy to take the test, so I use the folder to be accessed, set it to share, and then access it using php.

The simple test code is as follows:

The above code reads the size of the 1.png file shared by pic_gather/figure.pdf on the public computer.
Note that only the slash "/" can be used here, otherwise the access will fail. This is also the best way to make your code compatible with linux.

The code for accessing local resources is as follows:

[Php]

$ Filename = "D:/pic_gather/figure/1.png ";
$ Size = filesize ($ filename );
Echo $ size;

?>


Author: wolinxuebin

Required meta http-equiv = Content-Typecontent = text/html; charset = GBK? Php $ filename = D:/pic_gather/figure/1.png; $ size = filesize ($ filename); echo $ size ;? The company has no access to the Internet, but my work...

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.