<title>Bob ' s Auto parts-customer Orders</title>Bob ' s Auto Parts
Customer 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 all 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 mean by writing this? The Intval manual is the integer value that describes intval returns the variable var by using a specific binary conversion (by default, decimal). But what is the effect of assigning this integer value to $line[1]?
Reply to discussion (solution)
The intval () variable turns into an integer type $line[1] = Intval ($line [1]); $line [2] = Intval ($line [2]), $line [3] = Intval ($line [3]), and a variable that converts to an integer type to regroup an array $line you can also reassign the variable $line_a = intval ($line [1] ); $line _b = Intval ($line [2]), $line _c = Intval ($line [3]); Then your template shows that the corresponding needs change.
$line [1] = Intval ($line [1]);
Ensures that the value of the final $line [1] is an integer
Besides, the original author has already made a statement
38 lines have keep only the number of items ordered