It's strange to add data to the notepad and use t to split it. why is the length of each tab key inconsistent? Inconsistent?

Source: Internet
Author: User
Tags flock
It's strange to add data to the notepad and use t to split it. why is the length of each tab key inconsistent? Inconsistent? It's strange to add data to the notepad and use \ t to split it. The result is displayed in the notepad. are the tabs of different lengths different?

See figure


Reply to discussion (solution)

Someone answered?

The source code is as follows: two files, one for data submission and one for data processing.




















Order Results




Bob's auto Parts
Order Results
Echo"

Order Precessed ";
Echo date ('H: I, jS f ');
Echo"

";
?>

$ Totalqty = 0;
Print_r ($ _ POST );
Echo"
";

$ Tireqty = $ _ POST ['tireqty '];
$ Oilqty = $ _ POST ['ilqty '];
$ Sparkqty = $ _ POST ['sparkqty '];
$ Address = $ _ POST ['address'];
$ DOCUMENT_ROOT = $ _ SERVER ['document _ root'];
$ Totalqty = $ tireqty + $ oilqty + $ sparkqty;
$ Date = date ('H: I, jS FY ');
Echo "Item Ordered: $ totalqty
";
If ($ totalqty = 0 ){
Echo "You did not order anything on the Bob's site! ";
} Else {
If ($ tireqty> 0 ){
Echo $ tireqty. "tireqty
";
}
If ($ oilqty> 0 ){
Echo $ oilqty. "oilqty
";
}
If ($ sparkqty> 0 ){
Echo $ sparkqty. "sparkqty
";
}
}

$ Totalamount = 0.00;

Define ('tireprice', 100 );
Define ('oliprice ', 10 );
Define ('sparkprice', 4 );
$ Totalamount = $ tireqty * TIREPRICE
+ $ Oilqty * OLIPRICE
+ $ Sparkqty * SPARKPRICE;
$ Totalamount = number_format ($ totalamount, 2 ,'.','');
Echo"

Totalamount is $ ". $ totalamount ."

";
$ Tax_rate = 0.1;
$ Totalamount = $ totalamount * (1 + $ tax_rate );
Echo "Total including tax: $". $ totalamount ."
";

$ Putstrings = $ date. "\ t ". $ tireqty. "tires \ t ". $ oilqty. "oil \ t ". $ sparkqty. "spark plugs \ t ". "Totalamount $ ". $ totalamount. "\ t ". "Address ". $ address. "\ r \ n ";
Print_r ($ DOCUMENT_ROOT );
@ $ Fp = fopen ("$ DOCUMENT_ROOT/../orders/order.txt", 'AB ');
Flock ($ fp, LOCK_EX );
If (! $ Fp ){
Echo"

Your order is not processed at this time.
Please try again later.

";
Exit;
}
Fwrite ($ fp, $ putstrings, strlen ($ putstrings ));
Flock ($ fp, LOCK_UN );
Fclose ($ fp );
Echo "Order Written! ";

?>

This is a problem with notepad. you can use notepad ++ or another editor to open a text file.

This is related to the number of spaces equal to tab. Notepad looks like 8.

Related Article

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.