$taxonomies = $post->taxonomies()->get();
但是当我使用“echo”语句时,它的结果是如下所示的字符串。
echo $taxonomies[0];
// {"term_taxonomy_id":317,"term_id":317,"taxonomy":"skill","description":"","parent":0,"count":1,"pivot":{"object_id":4886,"term_taxonomy_id":317},"term":{"term_id":317,"name":"Consulting","slug":"consulting","term_group":0}}
但是当我使用“print_r”语句时,它的结果是如下所示的对象
print_r($taxonomies[0]);
Corcel\Model\Taxonomy Object
(
[table:protected] => term_taxonomy
[primaryKey:protected] => term_taxonomy_id
[with:protected] => Array
(
[0] => term
)
[timestamps] =>
[postType:protected] =>
[connection:protected] => wordpress
[keyType:protected] => int
[incrementing] => 1
[withCount:protected] => Array
(
)
[perPage:protected] => 15
[exists] => 1
....
我不清楚它是如何工作的?
繁花如伊
胡说叔叔