{"id":77873,"date":"2022-09-27T06:23:59","date_gmt":"2022-09-27T06:23:59","guid":{"rendered":"https:\/\/itsourcecode.com\/?p=77873"},"modified":"2023-11-21T09:14:33","modified_gmt":"2023-11-21T09:14:33","slug":"php-coding-standards-with-best-example","status":"publish","type":"post","link":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/","title":{"rendered":"PHP Coding Standards with Best Example"},"content":{"rendered":"\n<p>Based on the standard practices of every programmer, each organization has its own coding standards. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>PHP Coding Standards are important because there may be many programmers working on different modules.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>If each of them made their own coding standards, the source code would become very hard to manage, which would make it impossible to fix in the future.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Reason to maintain the coding standards:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Because of their familiarity, people working in different modules can easily handle the source code.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It serves as a model for other team members to learn the code for management or adjustments.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Because it is simple to understand, simplicity saves a lot of time when making common mistakes.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Coding standards or industry standards increase software quality and consistency.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>The following are a few recommendations to follow in order to maintain the standard of PHP coding.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-opening-and-closing-php-tags\"><strong>Opening and Closing PHP Tags<\/strong><\/h2>\n\n\n\n<p>To separate PHP code, you must <strong>use the standard PHP tags<\/strong> instead of the shorthand tags. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>This is required by PHP and is also the easiest way to include PHP code on different operating systems and in different ways.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Standard PHP Tag:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;php\n    \/\/php code here\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Shorthand PHP Tag:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?\n    \/\/php code here\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-single-and-double-quotes\"><strong>Single and Double Quotes<\/strong><\/h2>\n\n\n\n<p>When appropriate, use single and double quotation marks.<strong> If you are not evaluating any of the string&#8217;s contents, use single quotes<\/strong>.<\/p>\n\n\n\n<p>You should almost never need to escape quotes within a string, as you may just alternate your quoting style:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    \/\/ this is an example using a single quotation marks\n    echo '&lt;a href=\"#\" class=\"button\"&gt;This is using Single Quotes&lt;\/a&gt;';\n    echo '&lt;br&gt;';\n    \/\/ this is an example using double quotation marks\n    echo \"&lt;a href='{$escaped_link}'&gt;This is using Double Quotes&lt;\/a&gt;\";\n\n    \/\/ the incorrect way\n    echo \"&lt;a href=\"#\" class=\"button\"&gt;This is using Single Quotes&lt;\/a&gt;\";\n    echo '&lt;a href='{$escaped_link}'&gt;This is using Double Quotes&lt;\/a&gt;';\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-writing-include-require-statements\"><strong>Writing include\/require statements<\/strong><\/h2>\n\n\n\n<p class=\"tw-highlight-padding\">Since <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">include[_once]<\/mark><\/code> and <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">require[_once]<\/mark><\/code> are language constructs, they do not require parentheses around the path; therefore, they should not be used. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">Only <strong>one space should exist between the path<\/strong> and the include\/require keywords.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>It is strongly advised that <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">require[_once]<\/mark><\/code> unconditional includes be used. When using <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">include[_once]<\/mark><\/code>, PHP will throw a warning when the file is not found but will continue execution. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>If your application depends on the file being loaded, this will probably cause other <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\"><strong><em>errors<\/em><\/strong><\/mark><\/code>, <strong><code><mark style=\"background-color:var(--base-3);color:#fe0000\" class=\"has-inline-color\"><em>warnings<\/em><\/mark><\/code><\/strong>, or <strong><code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\"><em>notices<\/em><\/mark><\/code> <\/strong>to be thrown, which could leave security holes.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">Therefore, <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">require[_once]<\/mark><\/code> is the preferred option, as it throws a <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\"><strong><em>Fatal Error<\/em><\/strong><\/mark><\/code> if the file cannot be located.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    \/\/ This is the correct way\n    require_once 'header.php';\n\n    \/\/ The Incorrect way of writing include and require statements\n    include_once  ( 'file-name.php' );\n    require_once     __DIR__ . '\/file-name.php';\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-naming-conventions\"><strong>Naming Conventions<\/strong><\/h2>\n\n\n\n<p>Use lowercase letters for naming variables, actions, and functions (<strong>never camelCase<\/strong>). Separate each word with underscores. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Do not abbreviate variable names excessively; the code should be self-documenting and straightforward.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    \/\/ Do this\n    function some_name( $some_variable ) {}\n\n    \/\/ Don't do this\n    function someName( $variableName ) {}\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Class, trait, interface, and enum names should use capitalized and underscore-separated terms. All acronyms should be capitalized.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    class Walker_Category extends Walker {}\n    class WP_HTTP {}\n\n    interface Mailer_Interface {}\n    trait Forbid_Dynamic_Properties {}\n    enum Post_Status {}\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Constants should be capitalized with underscores between each word.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    define( 'PI_VALUE', true );\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>The names of files should be <strong>descriptive and all lowercase<\/strong>. Words should be <strong>separated by hyphens<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    require 'my-plugin-name.php';\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-space-usage\"><strong>Space Usage<\/strong><\/h2>\n\n\n\n<p>After commas and between logical, arithmetic, comparison, string, and assignment operators, always use spaces.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    SOME_CONST === 50;\n    foo() &amp;&amp; bar();\n    ! $bar;\n    array( 7, 3, 5 );\n    $baz . '-5';\n    $term .= 'X';\n    if ( $object instanceof Post_Type_Interface ) {}\n    $result = 3 ** 3; \/\/ 27\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Put spaces around the control structure parenthesis.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    foreach ( $foo as $bar ) {\n        ...\n    }\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Defining a function:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    function my_function( $param1 = 'sample', $param2 = 'text' ) { ...\n\n    function my_other_function() { ...\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Calling a function:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    sample_function( $param1, func_param( $param2 ) );\n    sample_function2();\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Performing Logical Comparisons:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    if ( ! $sample ) { ... }\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Always use the abbreviated form of Typecasts, (int) rather than (integer) and (bool) rather than (boolean), and write it with lowercase letters. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>However, for float casting, use (float), not (float) (real). This function is deprecated in PHP 7.4 and eliminated in PHP 8.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    foreach ( (array) $sample as $sample2 ) {\n    ...\n    $sample = (bool) $sample2;\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>In certain cases, while discussing array items, you should only place a space around the index if it is a variable, as seen below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    $z = $x['y']; \/\/ Correct.\n    $z = $x[ 'y' ]; \/\/ Incorrect.\n\n    $z = $x[0]; \/\/ Correct.\n    $z = $x[ 0 ]; \/\/ Incorrect.\n\n    $z = $x[ $y ]; \/\/ Correct.\n    $z = $x[$y]; \/\/ Incorrect.\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>In a switch block, however, there should be no spaces between the case condition and the colon.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    switch ( $x ) {\n    case 'yyy': \/\/ Correct.\n    case 'yy' : \/\/ Incorrect.\n}\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Likewise, return-type declarations should not have a space before the colon.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    function sum( $x, $y ): int {\n    return $x + $y;\n    }\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Except as explicitly indicated, parentheses should contain spaces.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    if ( $a &amp;&amp; ( $b || $c ) ) { ...\n\n    sample_function( ( $x - 1 ) * 5, $y );\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>When employing these operators, there should be no space between the increment (++) or decrement (&#8211;) operator and the variable it applies to.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    \/\/ Correct.\n    for ( $x = 0; $x &lt; 10; $x++ ) {}\n\n    \/\/ Incorrect.\n    for ( $x = 0; $x &lt; 10; $x ++ ) {}\n    ++   $a; \/\/ Multiple spaces.\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-indentation\"><strong>Indentation<\/strong><\/h2>\n\n\n\n<p>Your indentation should always match the structure of your argument. Use actual tabs, not spaces, as this provides for the best client compatibility.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>If you have a block of code that would be easier to read if it were aligned, use spaces instead of tabs.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n[tab]$x   = 'text value here';\n[tab]$x2  = 'text value here2';\n[tab]$x3 = 'text value here3';\n[tab]$x4  = 'text value here4';\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Associative arrays are the next topic covered in this section. When an array has many items, each item should begin on a new line.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    $query = new Query( array( 'ref_id' =&gt; 95876 ) );\n?&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    $args = array(\n    [tab]'post_type'   =&gt; 'page',\n    [tab]'post_author' =&gt; 95876,\n    [tab]'post_status' =&gt; 'publish',\n    );\n    \n    $query = new Query( $args );\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Note the comma after the final array item; this is suggested since it makes it simpler to adjust the array&#8217;s order and produces clearer differences when new items are added.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    $sample_array = array(\n    [tab]'x'   =&gt; 'text value here',\n    [tab]'x2'  =&gt; 'text value here 2',\n    [tab]'x3'  =&gt; 'text value here 3',\n    [tab]'x4'  =&gt; 'text value here 4',\n    );\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>For switch control structures, case statements must be indented one tab after the switch statement, and case contents must be indented one tab after the case condition statement.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    switch ( $type ) {\n    [tab]case 'var1':\n    [tab][tab]some_function();\n    [tab][tab]break;\n    [tab]case 'var2':\n    [tab][tab]some_function();\n    [tab][tab]break;\n    }\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>As&nbsp;a&nbsp;general&nbsp;rule,&nbsp;tabs&nbsp;should&nbsp;be&nbsp;used&nbsp;at&nbsp;the&nbsp;beginning&nbsp;of&nbsp;the&nbsp;line&nbsp;for&nbsp;indentation,&nbsp;while&nbsp;spaces&nbsp;can&nbsp;be&nbsp;used&nbsp;for alignment&nbsp;in&nbsp;the&nbsp;middle&nbsp;of&nbsp;the&nbsp;line.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-remove-trailing-spaces\"><strong>Remove Trailing Spaces<\/strong><\/h2>\n\n\n\n<p>Remove trailing whitespace from each line&#8217;s conclusion. It is preferred to omit the closing PHP tag at the conclusion of a file. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>If you employ the tag, remove any trailing spaces. A function body should not have any trailing blank lines.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-declaring-arrays\"><strong>Declaring Arrays<\/strong><\/h2>\n\n\n\n<p>Using long array syntax ( <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">array(1, 2, 3)<\/mark><\/code> ) to declare arrays is typically more understandable than using short array syntax ( <code><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">[1, 2, 3]<\/mark><\/code> ), especially for persons with vision impairments. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Additionally, it is considerably more descriptive for novices. Arrays must be declared using the long array syntax.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-multiline-function-calls\"><strong>Multiline Function Calls<\/strong><\/h2>\n\n\n\n<p>When a function call is divided across many lines, each parameter must be on a distinct line. Single-line inline comments may occupy a separate line.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Each parameter must not exceed a single line in length. Parameter values that span many lines must be assigned to a variable and then given to the function call.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    $bar = array(\n        'use_this' =&gt; true,\n        'meta_key' =&gt; 'field_name',\n    );\n    $baz = sprintf(\n        __( 'Hi, %s!', 'domain_text' ),\n        $friend_name\n    );\n\n    $a = x(\n        $x1,\n        $x2,\n        sprintf( __( 'My favorite food is %s.' ), 'pizza' )\n);\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-type-declarations\"><strong>Type declarations<\/strong><\/h2>\n\n\n\n<p>Before and after type declarations must have precisely one space. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>There should be no space between the nullability operator (?) and the actual type, as it is considered part of the type declaration.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Class\/interface\/enum name-based type declarations must match the case of the declared class\/interface\/enum name, whereas keyword-based type declarations must be in lowercase.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>There shouldn&#8217;t be a space between the closing brackets of a function declaration and the colon that starts a return-type declaration.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>These rules apply to all structures allowing for type declarations: functions, closures, enums, catch conditions, as well as the PHP 7.4 arrow functions and typed properties.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>&lt;?php\n    \/\/ Correct.\n    function foo( Class_Name $parameter, callable $callable, int $number_of_things = 0 ) {\n        \/\/ Do something.\n    }\n\n    function bar(\n        Interface_Name&amp;Concrete_Class $param_a,\n        string|int $param_b,\n        callable $param_c = 'default_callable'\n    ): User|false {\n        \/\/ Do something.\n    }\n    \n    \/\/ Incorrect.\n    function baz(Class_Name $param_a, String$param_b,      CALLABLE     $param_c )   :   ?   iterable   {\n        \/\/ Do something.\n    }\n?&gt;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-frequently-ask-questions-faqs\"><strong>Frequently Ask Questions (FAQs)<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-are-the-coding-standards-in-php\"><strong>What are the coding standards in PHP?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A &#8220;coding style guide&#8221; <strong>PSR [<a href=\"https:\/\/github.com\/php-fig\/fig-standards\/blob\/master\/accepted\/PSR-1-basic-coding-standard.md\">PSR-1<\/a>]<\/strong> MUST be followed when writing code.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Indenting code MUST be done with <strong>four spaces<\/strong>, not tabs.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>There should be no hard limit on line length; the soft limit should be <strong>120 characters<\/strong>, and lines should be <strong>80 characters or less<\/strong>.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After the namespace declaration, there MUST be <strong>one blank line<\/strong>, and after the block of use declarations, there MUST be one blank line.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The opening braces for classes MUST go on the next line, and the closing braces MUST go on the next line after the body.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The opening braces for methods MUST go on the next line, and the closing braces MUST go on the next line after the body.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>There must be <strong>one space<\/strong> after control structure keywords, but not after method and function calls.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>All properties and methods must have visibility declared; abstract and final must be declared before visibility; static must be declared after visibility.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Control structures with <strong>opening braces MUST go on the same line<\/strong>, and structures with closing braces MUST go on the line after the body.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>There MUST NOT be a <strong>space after opening parentheses<\/strong> for control structures, and there MUST NOT be a space before closing parentheses for control structures.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-are-php-coding-standards\"><strong>What are PHP coding standards?<\/strong><\/h3>\n\n\n\n<p><strong>Code standards<\/strong> consist of principles, procedures, and guidelines for producing code that is cleaner, more legible, and more efficient with fewer defects and errors. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In addition, they provide a standardized method for developers to construct highly functional programs.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Remember that coding standards are not subjective viewpoints; rather, they are actual guidelines that determine the programming style, techniques, and methods of your code. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>They must be specified openly and made accessible to developers. <strong>Coding standards<\/strong> ensure that all programmers adhere to specific principles. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Therefore, every developer, including novices, can easily comprehend, debug, and maintain the code. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Your team&#8217;s source code should look as if it were written by a single developer in a single session.&nbsp;<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-is-php-standardized\"><strong>Is PHP standardized?<\/strong><\/h3>\n\n\n\n<p>PHP Framework Interop Group has issued the PHP Standard Recommendation (PSR) as a PHP specification. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Similar to the Java Specification Request for Java, this document serves to standardize PHP programming ideas. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>It accomplishes this by outlining a shared set of norms and expectations for formatting PHP code.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-related-articles\"><strong>Related Articles<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/itsourcecode.com\/php-tutorial\/php-trait-with-detailed-explanation\/\">PHP trait With Detailed Explanation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itsourcecode.com\/php-tutorial\/types-of-operators-in-php-with-examples\/\">Types of Operators In PHP (With Examples)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itsourcecode.com\/php-tutorial\/php-upload-file-with-example\/\">PHP Upload File with Example<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itsourcecode.com\/php-tutorial\/php-tutorial-for-beginners-easy-learning-in-php\/\">PHP Tutorial For Beginners \u2013 Easy Learning In PHP<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/itsourcecode.com\/php-tutorial\/php-in_array-function-with-examples\/\">PHP in_array function With Examples<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-summary\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>In summary, we&#8217;ve examined the PHP coding standards and demonstrated how to write correct code with examples.<\/p>\n\n\n\n<p>Lastly, if you want to learn more about PHP, please leave a comment below. We\u2019ll be happy to hear it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Based on the standard practices of every programmer, each organization has its own coding standards. PHP Coding Standards are important because there may be many programmers working on different modules. &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"PHP Coding Standards with Best Example\" class=\"read-more button\" href=\"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#more-77873\" aria-label=\"Read more about PHP Coding Standards with Best Example\">Read more<\/a><\/p>\n","protected":false},"author":1373,"featured_media":77279,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61035],"tags":[95347,95346,13,95345,95348],"class_list":["post-77873","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-tutorial","tag-coding-standard-in-php-example","tag-coding-standards-in-php","tag-php","tag-php-coding-standards","tag-php-standards-example","resize-featured-image"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>PHP Coding Standards with Best Example<\/title>\n<meta name=\"description\" content=\"PHP Coding Standards is a set of rules that instruct programmers on what to do and what not to do. Here&#039;s an example for better understanding\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP Coding Standards with Best Example\" \/>\n<meta property=\"og:description\" content=\"PHP Coding Standards is a set of rules that instruct programmers on what to do and what not to do. Here&#039;s an example for better understanding\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Itsourcecode.com\" \/>\n<meta property=\"article:author\" content=\"www.facebook.com\/unguardable7\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-27T06:23:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-21T09:14:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/09\/php-coding-standards.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1460\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prince Ly Cesar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/www.twitter.com\/unguardable0729\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prince Ly Cesar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/\"},\"author\":{\"name\":\"Prince Ly Cesar\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/8d6ff1c108160ddbd60ff17cbb9f626b\"},\"headline\":\"PHP Coding Standards with Best Example\",\"datePublished\":\"2022-09-27T06:23:59+00:00\",\"dateModified\":\"2023-11-21T09:14:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/\"},\"wordCount\":1460,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\"},\"image\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/php-coding-standards.png\",\"keywords\":[\"coding standard in php example\",\"coding standards in php\",\"PHP\",\"php coding standards\",\"php standards example\"],\"articleSection\":[\"PHP Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/\",\"name\":\"PHP Coding Standards with Best Example\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/php-coding-standards.png\",\"datePublished\":\"2022-09-27T06:23:59+00:00\",\"dateModified\":\"2023-11-21T09:14:33+00:00\",\"description\":\"PHP Coding Standards is a set of rules that instruct programmers on what to do and what not to do. Here's an example for better understanding\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/#primaryimage\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/php-coding-standards.png\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/09\\\/php-coding-standards.png\",\"width\":1460,\"height\":900,\"caption\":\"php coding standards\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/php-tutorial\\\/php-coding-standards-with-best-example\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/itsourcecode.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP Coding Standards with Best Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#website\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/\",\"name\":\"Itsourcecode.com\",\"description\":\"Partner In Your Coding Journey!\",\"publisher\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/itsourcecode.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\",\"name\":\"itsourcecode\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"width\":409,\"height\":409,\"caption\":\"itsourcecode\"},\"logo\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\"},\"description\":\"Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!\",\"sameAs\":[\"https:\\\/\\\/itsourcecode.com\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/8d6ff1c108160ddbd60ff17cbb9f626b\",\"name\":\"Prince Ly Cesar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"caption\":\"Prince Ly Cesar\"},\"description\":\"Hi there! I'm Prince Ly Cesar a Student in Carlos Hilado Memorial State College - Binalbagan Campus and a Graphic Designer, Programmer &amp; Writer in IT SourceCode\",\"sameAs\":[\"https:\\\/\\\/activadorkeys.com\\\/\",\"www.facebook.com\\\/unguardable7\",\"http:\\\/\\\/www.instagram.com\\\/prnclycsr\\\/\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/www.twitter.com\\\/unguardable0729\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCF0BIqB5tpnCmwvYQCHucmw?view_as=subscriber\"],\"gender\":\"male\",\"knowsAbout\":[\"Graphic Designing\"],\"knowsLanguage\":[\"English\",\"Tagalog\"],\"jobTitle\":\"Graphic Designer\",\"worksFor\":\"IT SourceCode\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/author\\\/unguardable\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PHP Coding Standards with Best Example","description":"PHP Coding Standards is a set of rules that instruct programmers on what to do and what not to do. Here's an example for better understanding","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/","og_locale":"en_US","og_type":"article","og_title":"PHP Coding Standards with Best Example","og_description":"PHP Coding Standards is a set of rules that instruct programmers on what to do and what not to do. Here's an example for better understanding","og_url":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/","og_site_name":"Itsourcecode.com","article_author":"www.facebook.com\/unguardable7","article_published_time":"2022-09-27T06:23:59+00:00","article_modified_time":"2023-11-21T09:14:33+00:00","og_image":[{"width":1460,"height":900,"url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/09\/php-coding-standards.png","type":"image\/png"}],"author":"Prince Ly Cesar","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/www.twitter.com\/unguardable0729","twitter_misc":{"Written by":"Prince Ly Cesar","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#article","isPartOf":{"@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/"},"author":{"name":"Prince Ly Cesar","@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/8d6ff1c108160ddbd60ff17cbb9f626b"},"headline":"PHP Coding Standards with Best Example","datePublished":"2022-09-27T06:23:59+00:00","dateModified":"2023-11-21T09:14:33+00:00","mainEntityOfPage":{"@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/"},"wordCount":1460,"commentCount":0,"publisher":{"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc"},"image":{"@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#primaryimage"},"thumbnailUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/09\/php-coding-standards.png","keywords":["coding standard in php example","coding standards in php","PHP","php coding standards","php standards example"],"articleSection":["PHP Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/","url":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/","name":"PHP Coding Standards with Best Example","isPartOf":{"@id":"https:\/\/itsourcecode.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#primaryimage"},"image":{"@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#primaryimage"},"thumbnailUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/09\/php-coding-standards.png","datePublished":"2022-09-27T06:23:59+00:00","dateModified":"2023-11-21T09:14:33+00:00","description":"PHP Coding Standards is a set of rules that instruct programmers on what to do and what not to do. Here's an example for better understanding","breadcrumb":{"@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#primaryimage","url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/09\/php-coding-standards.png","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/09\/php-coding-standards.png","width":1460,"height":900,"caption":"php coding standards"},{"@type":"BreadcrumbList","@id":"https:\/\/itsourcecode.com\/php-tutorial\/php-coding-standards-with-best-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/itsourcecode.com\/"},{"@type":"ListItem","position":2,"name":"PHP Coding Standards with Best Example"}]},{"@type":"WebSite","@id":"https:\/\/itsourcecode.com\/#website","url":"https:\/\/itsourcecode.com\/","name":"Itsourcecode.com","description":"Partner In Your Coding Journey!","publisher":{"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itsourcecode.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc","name":"itsourcecode","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","width":409,"height":409,"caption":"itsourcecode"},"logo":{"@id":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg"},"description":"Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!","sameAs":["https:\/\/itsourcecode.com\/"]},{"@type":"Person","@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/8d6ff1c108160ddbd60ff17cbb9f626b","name":"Prince Ly Cesar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","url":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","caption":"Prince Ly Cesar"},"description":"Hi there! I'm Prince Ly Cesar a Student in Carlos Hilado Memorial State College - Binalbagan Campus and a Graphic Designer, Programmer &amp; Writer in IT SourceCode","sameAs":["https:\/\/activadorkeys.com\/","www.facebook.com\/unguardable7","http:\/\/www.instagram.com\/prnclycsr\/","https:\/\/x.com\/http:\/\/www.twitter.com\/unguardable0729","https:\/\/www.youtube.com\/channel\/UCF0BIqB5tpnCmwvYQCHucmw?view_as=subscriber"],"gender":"male","knowsAbout":["Graphic Designing"],"knowsLanguage":["English","Tagalog"],"jobTitle":"Graphic Designer","worksFor":"IT SourceCode","url":"https:\/\/itsourcecode.com\/author\/unguardable\/"}]}},"_links":{"self":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/77873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/users\/1373"}],"replies":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/comments?post=77873"}],"version-history":[{"count":26,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/77873\/revisions"}],"predecessor-version":[{"id":120579,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/77873\/revisions\/120579"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/media\/77279"}],"wp:attachment":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/media?parent=77873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/categories?post=77873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/tags?post=77873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}