In PHP, if you return 5 rows of data at the end of the text
1305140646,9,1,4,22013-5-14 16:40:00
1305140652,0,1,4,82013-5-14 16:50:00
1305140664,3,4,6,22013-5-14 17:00:00
1305140676,9,4,1,22013-5-14 17:10:00
1305140683,9,1,5,02013-5-14 17:20:00
1305140697,0,4,7,82013-5-14 17:30:00
1305140703,0,3,0,02013-5-14 17:40:00
1305140711,5,3,8,92013-5-14 17:50:00
1305140723,4,4,6,82013-5-14 18:00:00
1305140737,8,8,5,32013-5-14 18:10:00
Ask, in PHP, how to return a text (row height is dynamic) The last 5 rows of data.
The desired results are as follows
1305140697,0,4,7,82013-5-14 17:30:00
1305140703,0,3,0,02013-5-14 17:40:00
1305140711,5,3,8,92013-5-14 17:50:00
1305140723,4,4,6,82013-5-14 18:00:00
1305140737,8,8,5,32013-5-14 18:10:00
Share to:
------Solution--------------------
Isn't it the same?
$a = file (' http://web45800.w221.vhost058.cn/test.php ');
Print_r (Array_slice ($a,-5));
Array
(
[0] = 1305140824,3,0,0,42013-5-14 19:40:00
[1] = 1305140833,2,7,4,02013-5-14 19:50:00
[2] = 1305140842,5,9,9,42013-5-14 20:00:00
[3] = 1305140855,8,1,7,72013-5-14 20:10:00
[4] = 1305140861,3,7,5,72013-5-14 20:20:00
)