$ 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 "
Order Date |
Tires |
Oil |
Spark Plugs |
Total |
Address |
"; 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 "
".$line[0]." |
".$line[1]." |
".$line[2]." |
".$line[3]." |
".$line[4]." |
".$line[5]." |
"; } echo "
";?>
$ 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