Write the usage of the Fwirte function, a little depressed.

Source: Internet
Author: User
$name = $name [1]; $wei = '. /dow/'. $name. TXT '; $weizhi =fopen ($wei, ' a ') or die ("can ' t open file"); Fwrite ($weizhi, $neirong);


The $neirong is a bit big, and the big upper limit is estimated to be hundred M class.
The second question is: $name is the title of the calling database. When you go to perform a build.
He generates 2 files. One is. txt does not have a file name. The second one is the normal title.
。 A. txt file is less than a file with a normal file name, such as

. txt 4002k
Title. txt 12k

Q: It should only generate 1. Why is it 2? 2 builds are performed. And the strange thing is that I set the $name to the ID number type, he will normally generate 1 files, and the content is normal.


Reply to discussion (solution)

Do not quite understand what you want to ask, generate two files can only be your code deliberately done so.

Set file name For example 1.txt 2.txt he's normal. Generated for 1 files
If the file name is set to Chinese, such as the name of the. txt name 2.txt so he generates 1 more empty filenames.
For example. txt. txt

It's impossible!
You clear the data Catalog, and then you test.

It's impossible!
You clear the data Catalog, and then you test.

Test with ID to use as file name, no problem.

  • 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.