草庐IT

php - 如何从数组进行分页?

我有一个包含要分页显示的数据的数组。$display_array=Array([0]=>"0602xxx2",[1]=>"0602xxx3",[2]=>5//Total=2+3[3]=>"0602xxx3",[4]=>"0602saa4",[5]=>7//Total=3+4)我试过这样的事情functionpagination($display_array,$page){global$show_per_page;$page=$page";//Howtomanipulatethis?//TogettheresultasIdescribedbelow.}}我想做一个分页以获得这样的预期结果