大家好我有阵列系列季和剧集的名字 这里是我的阵列PHP的排序数组项问题
- The Flash 2.Sezon 11.Bölüm
- The Flash 2.Sezon 1.Bölüm
- The Flash 1.Sezon 20.Bölüm
- The Flash 2.Sezon 3.Bölüm
- The Flash 3.Sezon 3.Bölüm
(sezon =>季节,bolum =>情节在我的语言)
我要首发排序他们最后一集
- The Flash 1.Sezon 20.Bölüm
- The Flash 2.Sezon 1.Bölüm
- The Flash 2.Sezon 3.Bölüm
- The Flash 2.Sezon 11.Bölüm
- The Flash 3.Sezon 3.Bölüm
我试图ASORT功能,但没有奏效。以正确的顺序大多数项目,但他们中的一些not.Here是我的全码:
$args=array('post_type' => 'bolum',
'posts_per_page' =>-1,
'orderby' => 'title',
'meta_query' => array(array(
'key' => 'bolum_dizi',
'value' => '"' . $post_id . '"', // matches exaclty "123", not just 123. This prevents a match for "1234"
'compare' => 'LIKE'
)
)
);
$episodes = get_posts($args);
这也是我如何订购和打印
asort($episodes);
foreach($episodes as $episode){
echo $episode->post_title .'\n';}
我怎样才能做到这一点? 非常感谢。
你的代码是什么?你有什么尝试?预期产出是多少?实际产出是多少?我们可以帮助您解决代码中的问题,但我们无法理解您的想法。哦,也许可以用你的代码中定义的相同格式给你的输入数据。 –
我在帖子中提到过。我尝试了($ episodes); –
只是发布相关的代码。而不仅仅是一个功能的名称,没有足够的信息来说明它是如何使用的。 –