The code below returns an array of images that are "attached" to posts...
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => 0
);
$excludeImages = get_posts($args);
//var_dump
var_dump ($excludeImages)
//yields (a snippet of the first item of 5 in the array)
array(5){[0]=> object(stdClass)#194 (24)
{["ID"]=> int(46)
["guid"]=> string(59) "http://localhost/mysite/wp-content/uploads/avatar.png"}
The Question: How can I extract the image filename (in this case, avatar.png) from any given array item where the pattern is always ["guid"]=> string(int) "path-to-image"?