{"id":1000,"date":"2014-06-13T14:55:42","date_gmt":"2014-06-13T06:55:42","guid":{"rendered":"https:\/\/cowman-chiang.no-ip.org\/wordpress\/?p=1000"},"modified":"2019-06-20T10:25:06","modified_gmt":"2019-06-20T02:25:06","slug":"php%e5%bc%b7%e8%bf%ab%e8%bc%b8%e5%87%ba","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=1000","title":{"rendered":"PHP\u5f37\u8feb\u8f38\u51fa"},"content":{"rendered":"<p>Source: <a href=\"http:\/\/php.net\/manual\/en\/function.ob-flush.php\">http:\/\/php.net\/manual\/en\/function.ob-flush.php<\/a><\/p>\n<p>some problems with ob_flush() and flush() could be resolved by defining content type header :<br \/>\nheader( &#8216;Content-type: text\/html; charset=utf-8&#8217; );<\/p>\n<p>so working code looks like this:<\/p>\n<pre lang=\"php\">\n<?php\nheader( 'Content-type: text\/html; charset=utf-8' );\necho 'Begin ...<br \/>';\nfor( $i = 0 ; $i < 10 ; $i++ )\n{\n    echo $i . '<br \/>';\n    flush();\n    ob_flush();\n    sleep(1);\n}\necho 'End ...<br \/>';\n?>\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Source: http:\/\/php.net\/manual\/en\/function.ob-flush.php some problems with ob_flush() and flush() could be resolved by defining content type header : header( &#8216;Content-type: text\/html; charset=utf-8&#8217; ); so working code looks like this:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[],"class_list":["post-1000","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1000"}],"version-history":[{"count":1,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1000\/revisions"}],"predecessor-version":[{"id":2039,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1000\/revisions\/2039"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}