sorting the table fields using simple XML and xpath

前端 未结 2 1636
误落风尘
误落风尘 2020-12-07 06:17

I have a xml file loaded simplexml, and I need to sort the fields by price, or by author or title. How could I do? Is it ok do it using xpath or another way? I saw a similar

2条回答
  •  被撕碎了的回忆
    2020-12-07 07:10

    i know it sounds dumb at first: but map the data in an array and use a custom array callback for usort if you want to do it right right you will develop something that is called a paginator, which takes care of limit the result displayed on the page and lets you use custom filters.

提交回复
热议问题