{"id":62,"date":"2021-03-08T00:08:06","date_gmt":"2021-03-08T00:08:06","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=62"},"modified":"2025-04-06T01:46:53","modified_gmt":"2025-04-06T01:46:53","slug":"php-switch","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-tutorial\/php-switch\/","title":{"rendered":"PHP switch"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: In this tutorial, you will learn about the PHP switch statement, which executes a code block by matching an expression with multiple values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-php-switch-statement'>Introduction to the PHP switch statement <a href=\"#introduction-to-the-php-switch-statement\" class=\"anchor\" id=\"introduction-to-the-php-switch-statement\" title=\"Anchor for Introduction to the PHP switch statement\">#<\/a><\/h2>\n\n\n\n<p>When the value of a single variable determines the number of different choices, you can use the <code><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-if-elseif\/\">if...elseif<\/a><\/code> statement.<\/p>\n\n\n\n<p>Suppose that you&#8217;re building a website whose users have many roles like admin, editor, author, and subscriber.<\/p>\n\n\n\n<p>The following example uses an <code>if elseif<\/code> statement to display a different message based on the role of the user:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$role = <span class=\"hljs-string\">'subscriber'<\/span>;\n$message = <span class=\"hljs-string\">''<\/span>;\n\n<span class=\"hljs-keyword\">if<\/span> (<span class=\"hljs-string\">'admin'<\/span> === $role) {\n\t$message = <span class=\"hljs-string\">'Welcome, admin!'<\/span>;\n} <span class=\"hljs-keyword\">elseif<\/span> (<span class=\"hljs-string\">'editor'<\/span> === $role) {\n\t$message = <span class=\"hljs-string\">'Welcome! You have some pending articles to edit'<\/span>;\n} <span class=\"hljs-keyword\">elseif<\/span> (<span class=\"hljs-string\">'author'<\/span> === $role) {\n\t$message = <span class=\"hljs-string\">'Welcome! Do you want to publish the draft article?'<\/span>;\n} <span class=\"hljs-keyword\">elseif<\/span> (<span class=\"hljs-string\">'subscriber'<\/span> === $role) {\n\t$message = <span class=\"hljs-string\">'Welcome! Check out some new articles.'<\/span>;\n} <span class=\"hljs-keyword\">else<\/span> {\n\t$message = <span class=\"hljs-string\">'Sorry! You are not authorized to access this page'<\/span>;\n}\n\n<span class=\"hljs-keyword\">echo<\/span> $message;\n<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRyb2xlID0gJ3N1YnNjcmliZXInOwokbWVzc2FnZSA9ICcnOwoKaWYgKCdhZG1pbicgPT09ICRyb2xlKSB7CgkkbWVzc2FnZSA9ICdXZWxjb21lLCBhZG1pbiEnOwp9IGVsc2VpZiAoJ2VkaXRvcicgPT09ICRyb2xlKSB7CgkkbWVzc2FnZSA9ICdXZWxjb21lISBZb3UgaGF2ZSBzb21lIHBlbmRpbmcgYXJ0aWNsZXMgdG8gZWRpdCc7Cn0gZWxzZWlmICgnYXV0aG9yJyA9PT0gJHJvbGUpIHsKCSRtZXNzYWdlID0gJ1dlbGNvbWUhIERvIHlvdSB3YW50IHRvIHB1Ymxpc2ggdGhlIGRyYWZ0IGFydGljbGU_JzsKfSBlbHNlaWYgKCdzdWJzY3JpYmVyJyA9PT0gJHJvbGUpIHsKCSRtZXNzYWdlID0gJ1dlbGNvbWUhIENoZWNrIG91dCBzb21lIG5ldyBhcnRpY2xlcy4nOwp9IGVsc2UgewoJJG1lc3NhZ2UgPSAnU29ycnkhIFlvdSBhcmUgbm90IGF1dGhvcml6ZWQgdG8gYWNjZXNzIHRoaXMgcGFnZSc7Cn0KCmVjaG8gJG1lc3NhZ2U7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">Welcome! Check out some <span class=\"hljs-keyword\">new<\/span> articles.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When the value of a single variable specifies the number of different choices, it&#8217;s much cleaner to use the <code>switch<\/code> statement like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$role = <span class=\"hljs-string\">'admin'<\/span>;\n$message = <span class=\"hljs-string\">''<\/span>;\n\n<span class=\"hljs-keyword\">switch<\/span> ($role) {\n\t<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">'admin'<\/span>:\n\t\t$message = <span class=\"hljs-string\">'Welcome, admin!'<\/span>;\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">'editor'<\/span>:\n\t\t$message = <span class=\"hljs-string\">'Welcome! You have some pending articles to edit'<\/span>;\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">'author'<\/span>:\n\t\t$message = <span class=\"hljs-string\">'Welcome! Do you want to publish the draft article?'<\/span>;\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">'subscriber'<\/span>:\n\t\t$message = <span class=\"hljs-string\">'Welcome! Check out some new articles.'<\/span>;\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">default<\/span>:\n\t\t$message = <span class=\"hljs-string\">'You are not authorized to access this page'<\/span>;\n}\n\n<span class=\"hljs-keyword\">echo<\/span> $message;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRyb2xlID0gJ2FkbWluJzsKJG1lc3NhZ2UgPSAnJzsKCnN3aXRjaCAoJHJvbGUpIHsKCWNhc2UgJ2FkbWluJzoKCQkkbWVzc2FnZSA9ICdXZWxjb21lLCBhZG1pbiEnOwoJCWJyZWFrOwoJY2FzZSAnZWRpdG9yJzoKCQkkbWVzc2FnZSA9ICdXZWxjb21lISBZb3UgaGF2ZSBzb21lIHBlbmRpbmcgYXJ0aWNsZXMgdG8gZWRpdCc7CgkJYnJlYWs7CgljYXNlICdhdXRob3InOgoJCSRtZXNzYWdlID0gJ1dlbGNvbWUhIERvIHlvdSB3YW50IHRvIHB1Ymxpc2ggdGhlIGRyYWZ0IGFydGljbGU_JzsKCQlicmVhazsKCWNhc2UgJ3N1YnNjcmliZXInOgoJCSRtZXNzYWdlID0gJ1dlbGNvbWUhIENoZWNrIG91dCBzb21lIG5ldyBhcnRpY2xlcy4nOwoJCWJyZWFrOwoJZGVmYXVsdDoKCQkkbWVzc2FnZSA9ICdZb3UgYXJlIG5vdCBhdXRob3JpemVkIHRvIGFjY2VzcyB0aGlzIHBhZ2UnOwp9CgplY2hvICRtZXNzYWdlOw\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>The following illustrates the syntax of the <code>switch<\/code> statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-keyword\">switch<\/span> (expression) {\n\t<span class=\"hljs-keyword\">case<\/span> value1:\n\t\t<span class=\"hljs-comment\">\/\/ code block 1<\/span>\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">case<\/span> value2:\n\t\t<span class=\"hljs-comment\">\/\/ code block 2<\/span>\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">case<\/span> value3:\n\t\t<span class=\"hljs-comment\">\/\/ code block 3<\/span>\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">default<\/span>:\n\t\t<span class=\"hljs-comment\">\/\/ default code block<\/span>\n}\n<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>switch<\/code> statement compares an <code>expression<\/code> with the value in each case.<\/p>\n\n\n\n<p>If the expression equals a value in a case, e.g., <code>value1<\/code>, PHP executes the code block in the matching case until it encounters the first <code>break<\/code> statement.<\/p>\n\n\n\n<p>If there&#8217;s no match and the <code>default<\/code> is available, PHP executes all statements following the <code>default<\/code> keyword.<\/p>\n\n\n\n<p>In case the <code>default<\/code> is not specified, and there&#8217;s no match, the control is passed to the statement that follows the <code>switch<\/code> statement.<\/p>\n\n\n\n<p>The following flowchart illustrates how the <code>switch<\/code> statement works:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"346\" height=\"606\" src=\"https:\/\/phptutorial.net\/wp-content\/uploads\/2021\/03\/php-switch.png\" alt=\"PHP switch\" class=\"wp-image-401\" srcset=\"https:\/\/www.phptutorial.net\/wp-content\/uploads\/2021\/03\/php-switch.png 346w, https:\/\/www.phptutorial.net\/wp-content\/uploads\/2021\/03\/php-switch-171x300.png 171w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id='combining-cases'>Combining cases <a href=\"#combining-cases\" class=\"anchor\" id=\"combining-cases\" title=\"Anchor for Combining cases\">#<\/a><\/h2>\n\n\n\n<p>Since PHP executes the <code>switch<\/code> statement from the matching case label till it encounters the <code>break<\/code> statement, you can combine several cases in one.<\/p>\n\n\n\n<p>The following example uses the switch statement and combines the cases of <code>'editor'<\/code> and <code>'author'<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$message = <span class=\"hljs-string\">''<\/span>;\n$role = <span class=\"hljs-string\">'author'<\/span>;\n\n<span class=\"hljs-keyword\">switch<\/span> ($role) {\n\t<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">'admin'<\/span>:\n\t\t$message = <span class=\"hljs-string\">'Welcome, admin!'<\/span>;\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">'editor'<\/span>:\n\t<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">'author'<\/span>:\n\t\t$message = <span class=\"hljs-string\">'Welcome! Do you want to create a new article?'<\/span>;\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">'subscriber'<\/span>:\n\t\t$message = <span class=\"hljs-string\">'Welcome! Check out some new articles.'<\/span>;\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">default<\/span>:\n\t\t$message = <span class=\"hljs-string\">'You are not authorized to access this page'<\/span>;\n}\n\n<span class=\"hljs-keyword\">echo<\/span> $message;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRtZXNzYWdlID0gJyc7CiRyb2xlID0gJ2F1dGhvcic7Cgpzd2l0Y2ggKCRyb2xlKSB7CgljYXNlICdhZG1pbic6CgkJJG1lc3NhZ2UgPSAnV2VsY29tZSwgYWRtaW4hJzsKCQlicmVhazsKCWNhc2UgJ2VkaXRvcic6CgljYXNlICdhdXRob3InOgoJCSRtZXNzYWdlID0gJ1dlbGNvbWUhIERvIHlvdSB3YW50IHRvIGNyZWF0ZSBhIG5ldyBhcnRpY2xlPyc7CgkJYnJlYWs7CgljYXNlICdzdWJzY3JpYmVyJzoKCQkkbWVzc2FnZSA9ICdXZWxjb21lISBDaGVjayBvdXQgc29tZSBuZXcgYXJ0aWNsZXMuJzsKCQlicmVhazsKCWRlZmF1bHQ6CgkJJG1lc3NhZ2UgPSAnWW91IGFyZSBub3QgYXV0aG9yaXplZCB0byBhY2Nlc3MgdGhpcyBwYWdlJzsKfQoKZWNobyAkbWVzc2FnZTs\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/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\">Welcome! <span class=\"hljs-keyword\">Do<\/span> you want to create a <span class=\"hljs-keyword\">new<\/span> article?<\/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>In this example, if the <code>role<\/code> is <code>editor<\/code> or author, it&#8217;ll show the same message.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='php-switch-statements-alternative-syntax'>PHP switch statement&#8217;s alternative syntax <a href=\"#php-switch-statements-alternative-syntax\" class=\"anchor\" id=\"php-switch-statements-alternative-syntax\" title=\"Anchor for PHP switch statement&#039;s alternative syntax\">#<\/a><\/h2>\n\n\n\n<p>PHP also supports the alternative syntax for the <code>switch<\/code> statement as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-keyword\">switch<\/span> (expression):\n\t<span class=\"hljs-keyword\">case<\/span> value1:\n\t\t<span class=\"hljs-comment\">\/\/ code block 1<\/span>\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\t<span class=\"hljs-keyword\">case<\/span> value2:\n\t\t<span class=\"hljs-comment\">\/\/ code block 2<\/span>\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n\n\t<span class=\"hljs-keyword\">default<\/span>:\n\t\t<span class=\"hljs-comment\">\/\/ default code block<\/span>\n\t\t<span class=\"hljs-keyword\">break<\/span>;\n<span class=\"hljs-keyword\">endswitch<\/span>;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The alternative syntax is suitable for mixing with the HTML code.<\/p>\n\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>Use PHP <code>switch<\/code> statement instead of a series of <code>if<\/code> statements on the same expression.<\/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=\"62\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-switch\/\"\n\t\t\t\tdata-post-title=\"PHP switch\"\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=\"62\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-switch\/\"\n\t\t\t\tdata-post-title=\"PHP switch\"\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 the PHP switch statement that executes a code block by matching an expression with multiple values.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":15,"menu_order":27,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-62","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/62","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=62"}],"version-history":[{"count":5,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/62\/revisions"}],"predecessor-version":[{"id":2999,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/62\/revisions\/2999"}],"up":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/15"}],"wp:attachment":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/media?parent=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}