가 어떻게 제공 JSON 데이터의 배열에서 title
및 content
을 추출 할 수 있습니다 JSON 데이터의 배열에서 값을 추출 할 수 있습니다 I var_dump(WpApi::posts());
가 어떻게이 위해서 var_dump이
array(3) { ["results"]=> array(1)
{ [0]=> array(23)
{ ["id"]=> int(8)
["date"]=> string(19) "2017-01-31T07:08:21"
["date_gmt"]=> string(19) "2017-01-31T07:08:21"
["guid"]=> array(1) { ["rendered"]=> string(34) "http://idybrand.com/wordpress/?p=8" }
["modified"]=> string(19) "2017-01-31T07:08:21"
["modified_gmt"]=> string(19) "2017-01-31T07:08:21"
["slug"]=> string(34) "february-is-just-around-the-corner"
["type"]=> string(4) "post"
["link"]=> string(76) "http://idybrand.com/wordpress/2017/01/31/february-is-just-around-the-corner/"
["title"]=> array(1) { ["rendered"]=> string(34) "February is just around the corner" }
["content"]=> array(2) { ["rendered"]=> string(39) "
Appreciate this wonderful month
" ["protected"]=> bool(false) }
["excerpt"]=> array(2) { ["rendered"]=> string(39) "
Appreciate this wonderful month
" ["protected"]=> bool(false) }
["author"]=> int(1)
["featured_media"]=> int(0)
["comment_status"]=> string(4) "open"
["ping_status"]=> string(4) "open"
["sticky"]=> bool(false)
["template"]=> string(0) ""
["format"]=> string(8) "standard"
["meta"]=> array(0) { }
["categories"]=> array(1) { [0]=> int(1) }
["tags"]=> array(0) { }
["_links"]=> array(9) { ["self"]=> array(1) { [0]=> array(1) { ["href"]=> string(51) "http://idybrand.com/wordpress/wp-json/wp/v2/posts/8" } } ["collection"]=> array(1) { [0]=> array(1) { ["href"]=> string(49) "http://idybrand.com/wordpress/wp-json/wp/v2/posts" } } ["about"]=> array(1) { [0]=> array(1) { ["href"]=> string(54) "http://idybrand.com/wordpress/wp-json/wp/v2/types/post" } } ["author"]=> array(1) { [0]=> array(2) { ["embeddable"]=> bool(true) ["href"]=> string(51) "http://idybrand.com/wordpress/wp-json/wp/v2/users/1" } } ["replies"]=> array(1) { [0]=> array(2) { ["embeddable"]=> bool(true) ["href"]=> string(59) "http://idybrand.com/wordpress/wp-json/wp/v2/comments?post=8" } } ["version-history"]=> array(1) { [0]=> array(1) { ["href"]=> string(61) "http://idybrand.com/wordpress/wp-json/wp/v2/posts/8/revisions" } } ["wp:attachment"]=> array(1) { [0]=> array(1) { ["href"]=> string(58) "http://idybrand.com/wordpress/wp-json/wp/v2/media?parent=8" } } ["wp:term"]=> array(2) { [0]=> array(3) { ["taxonomy"]=> string(8) "category" ["embeddable"]=> bool(true) ["href"]=> string(61) "http://idybrand.com/wordpress/wp-json/wp/v2/categories?post=8" } [1]=> array(3) { ["taxonomy"]=> string(8) "post_tag" ["embeddable"]=> bool(true) ["href"]=> string(55) "http://idybrand.com/wordpress/wp-json/wp/v2/tags?post=8" } } ["curies"]=> array(1) { [0]=> array(3) { ["name"]=> string(2) "wp" ["href"]=> string(23) "https://api.w.org/{rel}" ["templated"]=> bool(true) } } } } }
["total"]=> string(1) "1"
["pages"]=> string(1) "1" }
이
를 PHP를하시기 바랍니다 사용할 때 다음과 같은
여기에는 많은 수평 스크롤이 필요합니다. 소스를보다 읽기 쉬운 형식으로 포맷 할 수 있습니까? – Gustave
@Gustave 위대한 아이디어지만, 나는 잘 모르겠다. 나는 시험해 볼 것이다 ;-) –