Cool-news trains are encoded in Json format. when collecting trains, you can directly collect trains. this interface can organize station, mileage, price, and other information into a table to facilitate processing. The standard version of the train collector can be used directly, and other program users can change the PHP code to run. & Lt ;? Phperror_reporting (7);/* vehicle count */$ id $ LabelAr
Cool-news trains are encoded in Json format. when collecting trains, you can directly collect trains. this interface can organize station, mileage, price, and other information into a table to facilitate processing.
The standard version of the train collector can be used directly, and other program users can change the PHP code to run.
Seattypes); foreach ($ content-> stations as $ key => $ station) {$ stationid = $ key + 1; $ pricelist = ""; $ distance = $ station-> distance; $ runtime = $ station-> runtime; foreach ($ seattypes as $ type) {switch ($ type) {case 'yz ': $ price = $ station-> price-> yz; break; case 'rz': $ price = $ station-> price-> rz; break; case 'yw ': $ price = $ station-> price-> ywx; break; case 'rw ': $ price = $ station-> price-> rwx; break; case 'yz ': $ price = $ station-> price-> ydz; break; case 'edz': $ price = $ station-> price-> edz; break; default: $ price = 0;} $ pricelist. ="{$ Price} RMB\ N ";}$ me. =" {$ Stationid} {$ Id} {$ Station-> name} {$ Station-> arrivaltime} {$ Station-> processing time} {$ Station-> staytime} {$ Station-> runtime} {$ Station-> distance} km{$ Pricelist}\ N ";}/* generate seat type */function getSeattype ($ type) {$ seattypes = array (" yz "=>" hard seat ", "rz" => "soft seat", "yw" => "hard sleeper", "yws" => "hard sleeper", "ywz" => "hard sleeper ", "ywx" => "hard sleeper", "rw" => "soft sleeper", "rws" => "soft sleeper", "rwx" => "soft sleeper ", "ydz" => "first class", "edz" => "second class"); return $ seattypes [$ type];} /* generate a table */function getInfo ($ id, $ seattypes, $ body, $ distance, $ runtime) {foreach ($ seattypes as $ value) based on the seat type) {$ value = getSeattype ($ value); $ seattype. ="$ Value\ R \ n ";} return $ body ="
| Vehicle count:{$ Id}(Full course: {$ distance} km) |
|
|
| Site Count |
Vehicle count |
Site Name |
Arrival time |
Driving time |
Stay |
Running time |
Mileage | {$ Seattype}
{$ Body}
| Range: {$ distance} km |
Full course: {$ runtime} |
";}$ LabelArray ['Introduction'] = getInfo ($ id, $ seattypes, $ me, $ distance, $ runtime ); // ############# the above is the user's Operation region #############//##### ####### the following statements must be retained, we recommend that you do not change the value ###### // ob_clean (); echo serialize ($ LabelArray);?>