I have this array of objects. However I want to only pull out the object which meets a certain criteria. If you look at the "post_title" key, I want to only pull out the object if it does not contain a comma. Is this possible?
So in my example below, I want to pull out the array in index 2 as that is the only one that has no comma in the "post_title" key.
Array
(
[0] => stdClass Object
(
[ID] => 504
[post_title] => Playroom (Black, Custom 2)
)
[1] => stdClass Object
(
[ID] => 503
[post_title] => Playroom (Black, Custom 1)
)
[2] => stdClass Object
(
[ID] => 252
[post_title] => Play (Black)
)
)
1
Thank you for looking at this.