{"id":101,"date":"2021-03-08T00:19:17","date_gmt":"2021-03-08T00:19:17","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=101"},"modified":"2025-04-07T11:22:27","modified_gmt":"2025-04-07T11:22:27","slug":"php-inheritance","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-oop\/php-inheritance\/","title":{"rendered":"PHP Inheritance"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn about the PHP inheritance that allows a class to reuse the code from another class.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-php-inheritance'>Introduction to the PHP inheritance <a href=\"#introduction-to-the-php-inheritance\" class=\"anchor\" id=\"introduction-to-the-php-inheritance\" title=\"Anchor for Introduction to the PHP inheritance\">#<\/a><\/h2>\n\n\n\n<p>Inheritance allows a class to reuse the code from another <a href=\"https:\/\/phptutorial.net\/php-oop\/php-objects\/\">class<\/a> without duplicating it.<\/p>\n\n\n\n<p>In inheritance, you have a <strong>parent<\/strong> class with properties and methods, and a <strong>child<\/strong> class can use the code from the parent class.<\/p>\n\n\n\n<p>Inheritance allows you to write the code in the parent class and use it in both parent and child classes.<\/p>\n\n\n\n<p>The parent class is also called a base class or super class. And the child class is also known as a derived class or a subclass.<\/p>\n\n\n\n<p>To define a class inherits from another class, you use the <code>extends<\/code> keyword.<\/p>\n\n\n\n<p>Suppose that you have a class called <code>BankAccount<\/code> as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">BankAccount<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">private<\/span> $balance;\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getBalance<\/span><span class=\"hljs-params\">()<\/span>\n    <\/span>{\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>-&gt;balance;\n    }\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">deposit<\/span><span class=\"hljs-params\">($amount)<\/span>\n    <\/span>{\n        <span class=\"hljs-keyword\">if<\/span> ($amount &gt; <span class=\"hljs-number\">0<\/span>) {\n            <span class=\"hljs-keyword\">$this<\/span>-&gt;balance += $amount;\n        }\n\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>;\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>BankAccount<\/code> class has the private property <code>$balance<\/code> and the public methods <code>getBalance()<\/code> and <code>deposit()<\/code>.<\/p>\n\n\n\n<p>To declare that the <code>SavingAccount<\/code> inherits from the <code>BankAccount<\/code>, you use the <code>extends<\/code> keyword as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">SavingAccount<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title\">BankAccount<\/span>\n<\/span>{\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, the <code>SavingAccount<\/code> can reuse all the non-private properties and methods from the <code>BankAccount<\/code> class.<\/p>\n\n\n\n<p>The following creates a new instance of the <code>SavingAccount<\/code> class, calls the <code>deposit()<\/code> method and shows the balance:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-keyword\">require<\/span> <span class=\"hljs-string\">'SavingAccount.php'<\/span>;\n\n$account = <span class=\"hljs-keyword\">new<\/span> SavingAccount();\n$account-&gt;deposit(<span class=\"hljs-number\">100<\/span>);\n<span class=\"hljs-keyword\">echo<\/span> $account-&gt;getBalance();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, the <code>SavingAccount<\/code> class reuses the properties and methods from the <code>BankAccount<\/code> class.<\/p>\n\n\n\n<p>A child class can reuse properties and methods from the parent class. But the parent class cannot use properties and methods from the child class.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='add-properties-and-methods-to-the-child-class'>Add properties and methods to the child class <a href=\"#add-properties-and-methods-to-the-child-class\" class=\"anchor\" id=\"add-properties-and-methods-to-the-child-class\" title=\"Anchor for Add properties and methods to the child class\">#<\/a><\/h2>\n\n\n\n<p>A child class can have its own properties and methods. In the following example, we add the <code>$interestRate<\/code> property and <code>setInterestRate()<\/code> method to the <code>SavingAccount<\/code> class:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">SavingAccount<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title\">BankAccount<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">private<\/span> $interestRate;\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">setInterestRate<\/span><span class=\"hljs-params\">($interestRate)<\/span>\n    <\/span>{\n        <span class=\"hljs-keyword\">$this<\/span>-&gt;interestRate = $interestRate;\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='call-methods-from-the-parent-class'>Call methods from the parent class <a href=\"#call-methods-from-the-parent-class\" class=\"anchor\" id=\"call-methods-from-the-parent-class\" title=\"Anchor for Call methods from the parent class\">#<\/a><\/h2>\n\n\n\n<p>To call a method from the parent class, you use the <code><a href=\"https:\/\/phptutorial.net\/php-oop\/php-this\/\">$this<\/a><\/code> keyword. <\/p>\n\n\n\n<p>The following example defines the <code>addInterest()<\/code> method that calculates the interest and adds it to the balance:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">SavingAccount<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title\">BankAccount<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">private<\/span> $interestRate;\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">setInterestRate<\/span><span class=\"hljs-params\">($interestRate)<\/span>\n    <\/span>{\n        <span class=\"hljs-keyword\">$this<\/span>-&gt;interestRate = $interestRate;\n    }\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">addInterest<\/span><span class=\"hljs-params\">()<\/span>\n    <\/span>{\n        <span class=\"hljs-comment\">\/\/ calculate interest<\/span>\n        $interest = <span class=\"hljs-keyword\">$this<\/span>-&gt;interestRate * <span class=\"hljs-keyword\">$this<\/span>-&gt;getBalance();\n        <span class=\"hljs-comment\">\/\/ deposit interest to the balance<\/span>\n        <span class=\"hljs-keyword\">$this<\/span>-&gt;deposit($interest);\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In the <code>addInterest()<\/code> method, we call the <code>getBalance()<\/code> method from the <code>BankAccount<\/code> class for calculating the interest and the <code>deposit()<\/code> method to add the interest to the balance.<\/p>\n\n\n\n<p>Put it all together:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">BankAccount<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">private<\/span> $balance;\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getBalance<\/span><span class=\"hljs-params\">()<\/span>\n    <\/span>{\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>-&gt;balance;\n    }\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">deposit<\/span><span class=\"hljs-params\">($amount)<\/span>\n    <\/span>{\n        <span class=\"hljs-keyword\">if<\/span> ($amount &gt; <span class=\"hljs-number\">0<\/span>) {\n            <span class=\"hljs-keyword\">$this<\/span>-&gt;balance += $amount;\n        }\n\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">$this<\/span>;\n    }\n}\n\n<span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">SavingAccount<\/span> <span class=\"hljs-keyword\">extends<\/span> <span class=\"hljs-title\">BankAccount<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">private<\/span> $interestRate;\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">setInterestRate<\/span><span class=\"hljs-params\">($interestRate)<\/span>\n    <\/span>{\n        <span class=\"hljs-keyword\">$this<\/span>-&gt;interestRate = $interestRate;\n    }\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">addInterest<\/span><span class=\"hljs-params\">()<\/span>\n    <\/span>{\n        <span class=\"hljs-comment\">\/\/ calculate interest<\/span>\n        $interest = <span class=\"hljs-keyword\">$this<\/span>-&gt;interestRate * <span class=\"hljs-keyword\">$this<\/span>-&gt;getBalance();\n        <span class=\"hljs-comment\">\/\/ deposit interest to the balance<\/span>\n        <span class=\"hljs-keyword\">$this<\/span>-&gt;deposit($interest);\n    }\n}\n\n$account = <span class=\"hljs-keyword\">new<\/span> SavingAccount();\n$account-&gt;deposit(<span class=\"hljs-number\">100<\/span>);\n<span class=\"hljs-comment\">\/\/ set interest rate<\/span>\n$account-&gt;setInterestRate(<span class=\"hljs-number\">0.05<\/span>);\n$account-&gt;addInterest();\n<span class=\"hljs-keyword\">echo<\/span> $account-&gt;getBalance();<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCmNsYXNzIEJhbmtBY2NvdW50CnsKICAgIHByaXZhdGUgJGJhbGFuY2U7CgogICAgcHVibGljIGZ1bmN0aW9uIGdldEJhbGFuY2UoKQogICAgewogICAgICAgIHJldHVybiAkdGhpcy0-YmFsYW5jZTsKICAgIH0KCiAgICBwdWJsaWMgZnVuY3Rpb24gZGVwb3NpdCgkYW1vdW50KQogICAgewogICAgICAgIGlmICgkYW1vdW50ID4gMCkgewogICAgICAgICAgICAkdGhpcy0-YmFsYW5jZSArPSAkYW1vdW50OwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuICR0aGlzOwogICAgfQp9CgpjbGFzcyBTYXZpbmdBY2NvdW50IGV4dGVuZHMgQmFua0FjY291bnQKewogICAgcHJpdmF0ZSAkaW50ZXJlc3RSYXRlOwoKICAgIHB1YmxpYyBmdW5jdGlvbiBzZXRJbnRlcmVzdFJhdGUoJGludGVyZXN0UmF0ZSkKICAgIHsKICAgICAgICAkdGhpcy0-aW50ZXJlc3RSYXRlID0gJGludGVyZXN0UmF0ZTsKICAgIH0KCiAgICBwdWJsaWMgZnVuY3Rpb24gYWRkSW50ZXJlc3QoKQogICAgewogICAgICAgIC8vIGNhbGN1bGF0ZSBpbnRlcmVzdAogICAgICAgICRpbnRlcmVzdCA9ICR0aGlzLT5pbnRlcmVzdFJhdGUgKiAkdGhpcy0-Z2V0QmFsYW5jZSgpOwogICAgICAgIC8vIGRlcG9zaXQgaW50ZXJlc3QgdG8gdGhlIGJhbGFuY2UKICAgICAgICAkdGhpcy0-ZGVwb3NpdCgkaW50ZXJlc3QpOwogICAgfQp9CgokYWNjb3VudCA9IG5ldyBTYXZpbmdBY2NvdW50KCk7CiRhY2NvdW50LT5kZXBvc2l0KDEwMCk7Ci8vIHNldCBpbnRlcmVzdCByYXRlCiRhY2NvdW50LT5zZXRJbnRlcmVzdFJhdGUoMC4wNSk7CiRhY2NvdW50LT5hZGRJbnRlcmVzdCgpOwplY2hvICRhY2NvdW50LT5nZXRCYWxhbmNlKCk7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='inhertiance-and-uml'>Inhertiance and UML <a href=\"#inhertiance-and-uml\" class=\"anchor\" id=\"inhertiance-and-uml\" title=\"Anchor for Inhertiance and UML\">#<\/a><\/h2>\n\n\n\n<p>You use the open arrow from the child class to the parent class to represent the inheritance relationship. The following UML diagram shows the inheritance relationship between the <code>BankAccount<\/code> and <code>SavingAccount<\/code> classes:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/phptutorial.net\/wp-content\/uploads\/2021\/03\/php-inheritance.svg\" alt=\"\" class=\"wp-image-641\"\/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Inheritance allows a class to reuse the code of another class without duplicating it.<\/li>\n\n\n\n<li>Use the <code>extends<\/code> keyword to define one class that inherits from another class.<\/li>\n\n\n\n<li>A class that inherits another class is called a subclass, a child class, or a derived class. The class from which the subclass inherits is a parent class, a superclass, or a base class.<\/li>\n\n\n\n<li>A subclass can have its own properties and methods.<\/li>\n\n\n\n<li>Use <code>$this<\/code> keyword to call the methods of the parent class from methods in the child class.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Did you find this tutorial useful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"101\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-oop\/php-inheritance\/\"\n\t\t\t\tdata-post-title=\"PHP Inheritance\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"101\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-oop\/php-inheritance\/\"\n\t\t\t\tdata-post-title=\"PHP Inheritance\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn about PHP inheritance and how to use the extends keyword to implement inheritance between classes.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1753,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-101","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":5,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/101\/revisions"}],"predecessor-version":[{"id":3225,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/101\/revisions\/3225"}],"up":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/1753"}],"wp:attachment":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/media?parent=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}