{"id":381,"date":"2012-06-07T11:57:06","date_gmt":"2012-06-07T11:57:06","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=381"},"modified":"2022-02-17T07:14:04","modified_gmt":"2022-02-17T07:14:04","slug":"creating-debug-output-file","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/files\/creating-debug-output-file","title":{"rendered":"Creating Debug Output File"},"content":{"rendered":"<p>This will write \/ overwrite a file called test.txt in the local directory of the php file.  You may need to create thr file first and enable write permissions for it to work.<\/p>\n<pre><code>\r\n  $data = \"START-\".strftime('%c').\"-START\";\r\n  $file = \"test.txt\"; \r\n  $fp = fopen($file, \"w\") or die(\"Couldn't open file for writing!\");\r\n  fwrite($fp, $data) or die(\"Couldn't write values to file!\"); \r\n  fclose($fp); \r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This will write \/ overwrite a file called test.txt in the local directory of the php file. You may need to create thr file first and enable write permissions for it to work. $data = &#8220;START-&#8220;.strftime(&#8216;%c&#8217;).&#8221;-START&#8221;; $file = &#8220;test.txt&#8221;; $fp = fopen($file, &#8220;w&#8221;) or die(&#8220;Couldn&#8217;t open file for writing!&#8221;); fwrite($fp, $data) or die(&#8220;Couldn&#8217;t write values [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-381","post","type-post","status-publish","format-standard","hentry","category-files"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=381"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/381\/revisions"}],"predecessor-version":[{"id":1443,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/381\/revisions\/1443"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}