使用foreach循环创建关联数组的方法
P粉381463780
P粉381463780 2023-08-16 13:21:43
0
1
336
<p><br /></p> <pre class="brush:php;toolbar:false;">$featured_posts = get_field('parts', $postId->ID); if( $featured_posts ): foreach( $featured_posts as $post ): setup_postdata($post); $permalink = get_permalink( $part->ID ); $title = get_the_title( $part->ID ); //make array $part_pages = array( $permalink => $title, ); endforeach; wp_reset_postdata(); endif;</pre> <p>我试图使用foreach循环创建一个关联数组,但是出现了错误。任何帮助将不胜感激。</p>
P粉381463780
P粉381463780

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!