如何从PHP Object获取价值

时间:2016-01-19 08:22:14

标签: php

我有一个对象$post_object。我想从中获取ID。我将如何实现它?我将它视为数组但我的页面卡住了,我无法看到它的值。这是我的目标。

WP_Post Object
(
    [ID] => 457
    [post_author] => 1
    [post_date] => 2015-12-14 06:40:12
    [post_date_gmt] => 2015-12-14 06:40:12
    [post_content] => 
    [post_title] => The Biggie
    [post_excerpt] => 
    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [post_password] => 
    [post_name] => the-biggie
    [to_ping] => 
    [pinged] => 
    [post_modified] => 2015-12-14 06:40:12
    [post_modified_gmt] => 2015-12-14 06:40:12
    [post_content_filtered] => 
    [post_parent] => 0
    [guid] => http://socialcize.com/new/?post_type=sm_points_templates&p=457
    [menu_order] => 0
    [post_type] => sm_points_templates
    [post_mime_type] => 
    [comment_count] => 0
    [filter] => raw
)

我只想从中返回ID,值457.

提前谢谢你。

0 个答案:

没有答案