$ Line [1] = intval ($ line [1]); // What does this write mean?

Source: Internet
Author: User
$ Line [1] intval ($ line [1]); what does this write mean?
   Bob's Auto Parts - Customer OrdersBob's Auto PartsCustomer Orders
 No orders pending.          Please try again later.

"; } echo " \n"; echo " "; for ($i=0; $i<$number_of_orders; $i++) { //split up each line $line = explode("\t", $orders[$i]); // keep only the number of items ordered $line[1] = intval($line[1]); $line[2] = intval($line[2]); $line[3] = intval($line[3]); // output each order echo " "; } echo "
Order Date Tires Oil Spark Plugs Total Address
".$line[0]." ".$line[1]." ".$line[2]." ".$line[3]." ".$line[4]." ".$line[5]."
";?>


$ Line [1] = intval ($ line [1]); // What does this write mean? The intval manual describes how intval returns the integer value of the variable var by using a specific hexadecimal conversion (decimal by default. But what is the role of assigning this integer value to $ line [1?


Reply to discussion (solution)

Intval () variable to integer type $ line [1] = intval ($ line [1]); $ line [2] = intval ($ line [2]); $ line [3] = intval ($ line [3]); convert to an integer type variable and recombine the array $ line. you can also, assign a value to the variable $ line_a = intval ($ line [1]); $ line_ B = intval ($ line [2]); $ line_c = intval ($ line [3]); then, your template shows that the corresponding changes are required.

$ Line [1] = intval ($ line [1]);
Make sure that the final value of $ line [1] is an integer.

What's more, the original author has already explained
38 rows have keep only the number of items ordered

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.