{"id":258,"date":"2018-01-04T08:12:25","date_gmt":"2018-01-04T08:12:25","guid":{"rendered":"http:\/\/mddir.com\/how-to\/?p=258"},"modified":"2018-01-04T08:12:25","modified_gmt":"2018-01-04T08:12:25","slug":"use-php-comments","status":"publish","type":"post","link":"https:\/\/www.mddir.com\/how-to\/use-php-comments\/","title":{"rendered":"Use PHP Comments"},"content":{"rendered":"<p>Writing comments while doing codding is good practice. It helps other developers to understand your code. There are three ways of using the php comments.<\/p>\n<p><code>\/\/<\/code> &#8211; The two backlash &#8220;<code>\/\/<\/code>&#8221; indicates the code written after the backlash cannot be executed in the php file. The browser will ignore the code mention after the backlashes.<\/p>\n<p><code>#<\/code> &#8211; The hash &#8220;<code>#<\/code>&#8221; indicates the code mention after the hash is the comment. It will not run in the browser and simply neglected.<\/p>\n<p><code>\/* text *\/<\/code> &#8211; The slash and asterisk sign are used to mention the long line comment. Sometimes developer uses the complete sentence or paragraph to describe the code they are using for a particular function to run. This comment format allows the developer to write a long comment in a paragraph.<\/p>\n<p><strong>Example of php comment:<\/strong><\/p>\n<p><code>&lt;?php<\/p>\n<p>\/\/ This line will be ignored by browsers.<\/p>\n<p># The hash indicate do not run the text.<\/p>\n<p>\/*<br \/>\nThis is useful for long paragraph comment<br \/>\nas you want to provide more information<br \/>\nto describe the code.<br \/>\n*\/<\/p>\n<p>?&gt;<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Writing comments while doing codding is good practice. It helps other developers to understand your code. There are three ways of using the php comments.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-258","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/comments?post=258"}],"version-history":[{"count":1,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/258\/revisions"}],"predecessor-version":[{"id":259,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/258\/revisions\/259"}],"wp:attachment":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/media?parent=258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/categories?post=258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/tags?post=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}