I have a one item array whos contents, using var_dump() are as follows:
array(1) {
[0]=> object(stdClass)#519 (23) {
["ID"]=> string(3) "907"
["post_author"]=> string(1) "2"
["post_date"]=> string(19) "2010-07-07 18:48:31"
["post_date_gmt"]=> string(19) "2010-07-07 18:48:31"
["post_content"]=> string(532) "The details of the listing will go here. They will all be stored as custom fields relative to this page. Then they will be displayed below using whatever CSS markup is appropriate.[mappress]"
["post_title"]=> string(8) "432 Hill"
["post_excerpt"]=> string(523) "The details of the listing will go here. They will all be stored as custom fields relative to this page. Then they will be displayed below using whatever CSS markup is appropriate."
["post_status"]=> string(7) "publish"
["comment_status"]=> string(4) "open"
["ping_status"]=> string(4) "open"
["post_password"]=> string(0) ""
["post_name"]=> string(8) "677-shazzll"
["to_ping"]=> string(0) ""
["pinged"]=> string(0) ""
["post_modified"]=> string(19) "2010-07-09 17:09:33"
["post_modified_gmt"]=> string(19) "2010-07-09 17:09:33"
["post_content_filtered"]=> string(0) ""
["post_parent"]=> string(1) "0"
["guid"]=> string(40) "http://www.yourwebsite/test/?p=907"
["menu_order"]=> string(1) "0"
["post_type"]=> string(4) "post"
["post_mime_type"]=> string(0) ""
["comment_count"]=> string(1) "0" } }
I am trying to access this array as $pageposts[0] and continue to get errors and cannot access it. The error is: Catchable fatal error: Object of class stdClass could not be converted to string
This array is the contents of one record in a database, and I am trying to extract the “?p=907” text from the array item.
Can anyone offer any advice on how to access this array item or how to capture that particular text component?
Thanks.