{"id":2322,"date":"2021-07-20T07:59:04","date_gmt":"2021-07-20T07:59:04","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=2322"},"modified":"2021-07-20T07:59:33","modified_gmt":"2021-07-20T07:59:33","slug":"php-method_exists","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-oop\/php-method_exists\/","title":{"rendered":"PHP method_exists"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use the PHP <code>method_exists()<\/code> function to check if a class or an object of a class has a specified method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-php-method_exists-function'>Introduction to the PHP method_exists function <a href=\"#introduction-to-the-php-method_exists-function\" class=\"anchor\" id=\"introduction-to-the-php-method_exists-function\" title=\"Anchor for Introduction to the PHP method_exists function\">#<\/a><\/h2>\n\n\n\n<p>The <code>method_exists()<\/code> function returns <code>true<\/code> if <a href=\"https:\/\/phptutorial.net\/php-oop\/php-objects\/\">an object or a class<\/a> has a specified method. Otherwise, it returns <code>false<\/code>.<\/p>\n\n\n\n<p>The syntax of the <code>method_exists()<\/code> function is 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\">method_exists(object|string $object_or_class, string $method): bool<\/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>method_exists()<\/code> has two parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>$object_or_class<\/code> is an object or a class in which you want to check if a method exists.<\/li><li><code>$method<\/code> is a string that represents the method to check.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='php-method_exists-function-examples'>PHP method_exists function examples <a href=\"#php-method_exists-function-examples\" class=\"anchor\" id=\"php-method_exists-function-examples\" title=\"Anchor for PHP method_exists function examples\">#<\/a><\/h2>\n\n\n\n<p>Let&#8217;s take some examples of using the <code>method_exists()<\/code> function.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='1-using-the-php-method_exists-function-to-check-if-a-class-has-a-method'>1) Using the PHP method_exists() function to check if a class has a method  <a href=\"#1-using-the-php-method_exists-function-to-check-if-a-class-has-a-method\" class=\"anchor\" id=\"1-using-the-php-method_exists-function-to-check-if-a-class-has-a-method\" title=\"Anchor for 1) Using the PHP method_exists() function to check if a class has a method \">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>method_exists()<\/code> function to check if a method exists in the <code>BankAccount<\/code> class:<\/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\">BankAccount<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">transferTo<\/span><span class=\"hljs-params\">(BankAccount $other, float $amount)<\/span>\n    <\/span>{\n        <span class=\"hljs-comment\">\/\/ more code<\/span>\n    }\n}\n\n$exists = method_exists(BankAccount::class, <span class=\"hljs-string\">'transferTo'<\/span>);\nvar_dump($exists); <span class=\"hljs-comment\">\/\/ bool(true)<\/span>\n\n$exists = method_exists(BankAccount::class, <span class=\"hljs-string\">'deposit'<\/span>);\nvar_dump($exists); <span class=\"hljs-comment\">\/\/ bool(false)<\/span><\/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 following statement returns <code>true<\/code> because the <code>transferTo<\/code> method exists in the <code>BankAccount<\/code> class:<\/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\">method_exists(BankAccount::class, <span class=\"hljs-string\">'transferTo'<\/span>);<\/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>However, the following statement returns <code>false<\/code> because the <code>deposit<\/code> method doesn&#8217;t exist in the <code>BankAccount<\/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\">method_exists(BankAccount::class, <span class=\"hljs-string\">'deposit'<\/span>);<\/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<h3 class=\"wp-block-heading\" id='2-using-the-php-method_exists-function-to-check-if-an-object-has-a-method'>2) Using the PHP method_exists function to check if an object has a method <a href=\"#2-using-the-php-method_exists-function-to-check-if-an-object-has-a-method\" class=\"anchor\" id=\"2-using-the-php-method_exists-function-to-check-if-an-object-has-a-method\" title=\"Anchor for 2) Using the PHP method_exists function to check if an object has a method\">#<\/a><\/h3>\n\n\n\n<p>The following example creates a new object of the <code>BankAccount<\/code> and uses the <code>method_exists()<\/code> function to check the object has a specified method:<\/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\">BankAccount<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">transferTo<\/span><span class=\"hljs-params\">(BankAccount $other, float $amount)<\/span>\n    <\/span>{\n        <span class=\"hljs-comment\">\/\/ more code<\/span>\n    }\n}\n\n$account = <span class=\"hljs-keyword\">new<\/span> BankAccount();\n\n$exists = method_exists($account, <span class=\"hljs-string\">'transferTo'<\/span>);\nvar_dump($exists); <span class=\"hljs-comment\">\/\/ bool(true)<\/span>\n\n$exists = method_exists($account, <span class=\"hljs-string\">'deposit'<\/span>);\nvar_dump($exists); <span class=\"hljs-comment\">\/\/ bool(false)<\/span><\/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>The <code>$account<\/code> object has the <code>transferTo<\/code> method, therefore, the following statement returns <code>true<\/code>:<\/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\">method_exists($account, <span class=\"hljs-string\">'transferTo'<\/span>);<\/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>On the other hand, the $account object doesn&#8217;t have the <code>deposit<\/code> method. Therefore, the following statement returns <code>false<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">method_exists($account, <span class=\"hljs-string\">'deposit'<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><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<h3 class=\"wp-block-heading\" id='3-using-the-method_exists-function-to-check-if-an-object-has-a-static-method'>3) Using the method_exists function to check if an object has a static method <a href=\"#3-using-the-method_exists-function-to-check-if-an-object-has-a-static-method\" class=\"anchor\" id=\"3-using-the-method_exists-function-to-check-if-an-object-has-a-static-method\" title=\"Anchor for 3) Using the method_exists function to check if an object has a static method\">#<\/a><\/h3>\n\n\n\n<p>The <code>method_exists()<\/code> also returns <code>true<\/code> if a class has a <a href=\"https:\/\/phptutorial.net\/php-oop\/php-static-methods\/\">static method<\/a>. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" 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\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">transferTo<\/span><span class=\"hljs-params\">(BankAccount $other, float $amount)<\/span>\n    <\/span>{\n        <span class=\"hljs-comment\">\/\/ more code<\/span>\n    }\n\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">static<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">compare<\/span><span class=\"hljs-params\">(BankAccount $other)<\/span>: <span class=\"hljs-title\">bool<\/span>\n    <\/span>{\n        <span class=\"hljs-comment\">\/\/ implementation<\/span>\n        <span class=\"hljs-comment\">\/\/ ...<\/span>\n        <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-keyword\">false<\/span>;\n    }\n}\n\n$exists = method_exists(BankAccount::class, <span class=\"hljs-string\">'compare'<\/span>);\nvar_dump($exists); <span class=\"hljs-comment\">\/\/ bool(true)<\/span>\n\n$account = <span class=\"hljs-keyword\">new<\/span> BankAccount();\n$exists = method_exists($account, <span class=\"hljs-string\">'compare'<\/span>);\nvar_dump($exists); <span class=\"hljs-comment\">\/\/ bool(true)<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><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> has the <code>compare<\/code> static method, so the following statement returns <code>true<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">method_exists(BankAccount::class, <span class=\"hljs-string\">'compare'<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><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>$account<\/code> is an instance of the <code>BankAccount<\/code> class that has the <code>compare<\/code> static method, the following expression also returns <code>true<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">$exists = method_exists($account, <span class=\"hljs-string\">'compare'<\/span>);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><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='php-method_exists-function-in-mvc-frameworks'>PHP method_exists function in MVC frameworks <a href=\"#php-method_exists-function-in-mvc-frameworks\" class=\"anchor\" id=\"php-method_exists-function-in-mvc-frameworks\" title=\"Anchor for PHP method_exists function in MVC frameworks\">#<\/a><\/h2>\n\n\n\n<p>The <code>method_exists()<\/code> method is often used in Model-View-Controller (MVC) frameworks to check if a controller class has a certain method before calling it.<\/p>\n\n\n\n<p>For example, suppose that you have the following request URI:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">\/posts\/edit\/<span class=\"hljs-number\">1<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><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>This URI has three parts: posts, edit, and 1.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The <code>posts<\/code> maps to the <code>PostsController<\/code> class.<\/li><li>The <code>edit<\/code> maps the <code>edit<\/code> method of the class.<\/li><li>The number <code>1<\/code> is the post id to edit.<\/li><\/ul>\n\n\n\n<p>The <code>PostsController<\/code> class will look like the following:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" 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\">PostsController<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">edit<\/span><span class=\"hljs-params\">(int $id)<\/span>\n    <\/span>{\n        <span class=\"hljs-comment\">\/\/ show the edit post form<\/span>\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><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>And you use the <code>method_exists()<\/code> function to check whether the edit method exists in the <code>$controller<\/code> object like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n<span class=\"hljs-comment\">\/\/ ...<\/span>\n<span class=\"hljs-keyword\">if<\/span>(method_exists($controller, $action))\n{\n    $controller-&gt;$action($id);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><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='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Use the PHP <code>method_exists()<\/code> function to check if an object or a class has a specified method.<\/li><\/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=\"2322\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-oop\/php-method_exists\/\"\n\t\t\t\tdata-post-title=\"PHP method_exists\"\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=\"2322\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-oop\/php-method_exists\/\"\n\t\t\t\tdata-post-title=\"PHP method_exists\"\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&#8217;ll learn how to use the PHP method_exists() function to check if a class or an object of a class has a specified method.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1753,"menu_order":38,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2322","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2322","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=2322"}],"version-history":[{"count":2,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2322\/revisions"}],"predecessor-version":[{"id":2324,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2322\/revisions\/2324"}],"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=2322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}