& Quot; $ recent_postswp_get_recent_posts (& #39; orderbyrand & amp; showposts & #39 ;. $ number. & #39; & amp; category & #39 ;. $ fenlei); traverses each article. Foreach ($ recent_postsas $ recent) {$ a & #39; & #39 ;. $ recent [& quot; post_title & quot;]. & #39; & #39; $ B [] $ php
$ Recent_posts = wp_get_recent_posts ('orderby = rand & showposts = '. $ number.' & category = '. $ fenlei); // traverse each article. Foreach ($ recent_posts as $ recent) {$ a =''. $ Recent ["post_title"].''; $ B [] = $ a;} return $ B [0]. $ B [1]. $ B [2]. $ B [3]. $ B [4];}
The younger brother has written such a traversal article, but it is puzzled that after receiving the traversal content with an array, the younger brother uses this return $ B [0]. $ B [1]. $ B [2]. $ B [3]. $ B [4]; returns the Array, but returns $ B Directly. Array is displayed. it is speechless. I learned PHP today. thank you for your advice.