下面的代码返回一个“附加”到帖子的图像数组......
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => 0
);
$excludeImages = get_posts($args);
//var_dump
var_dump ($excludeImages)
//yields(数组中第 5 项的片段)
array(5){[0]=> object(stdClass)#194 (24)
{["ID"]=> int(46)
["guid"]=> string(59) "http://localhost/mysite/wp-content/uploads/avatar.png"}
问题: 如何从模式始终为 ["guid"]=> string(int) "path-to-image" 的任何给定数组项中提取图像文件名(在本例中为 avatar.png)?