{"id":2016,"date":"2021-06-27T02:18:34","date_gmt":"2021-06-27T02:18:34","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=2016"},"modified":"2025-04-05T14:34:47","modified_gmt":"2025-04-05T14:34:47","slug":"php-type-casting","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-tutorial\/php-type-casting\/","title":{"rendered":"PHP Type Casting"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: In this tutorial, you&#8217;ll learn about PHP type casting, which allows you to convert a value of one type to another.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-php-type-casting'>Introduction to the PHP type casting <a href=\"#introduction-to-the-php-type-casting\" class=\"anchor\" id=\"introduction-to-the-php-type-casting\" title=\"Anchor for Introduction to the PHP type casting\">#<\/a><\/h2>\n\n\n\n<p>Type casting allows you to convert a value of one type to another. To cast a value, you use the following type-casting operators:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Cast Operators<\/th><th>Conversion<\/th><\/tr><\/thead><tbody><tr><td>(array)<\/td><td><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-array\/\">Array<\/a><\/td><\/tr><tr><td>(bool) or (boolean)<\/td><td><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-boolean\/\">Boolean<\/a><\/td><\/tr><tr><td>(int) or (integer)<\/td><td><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-int\/\">Integer<\/a><\/td><\/tr><tr><td>(object)<\/td><td><a href=\"https:\/\/phptutorial.net\/php-oop\/php-objects\/\">Object<\/a><\/td><\/tr><tr><td>(real), (double), or (float)<\/td><td><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-float\/\">Float<\/a><\/td><\/tr><tr><td>(string)<\/td><td><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-string\/\">String<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Let&#8217;s take some examples of using the type casting operators.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='cast-to-an-integer'>Cast to an integer <a href=\"#cast-to-an-integer\" class=\"anchor\" id=\"cast-to-an-integer\" title=\"Anchor for Cast to an integer\">#<\/a><\/h2>\n\n\n\n<p>To cast a value to an integer, you use the <code>(int)<\/code> type-casting operator.<\/p>\n\n\n\n<p>The <code>(int)<\/code> operator casts a float to an integer. It&#8217;ll round the result towards zero. For example:<\/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-keyword\">echo<\/span> (int)<span class=\"hljs-number\">12.5<\/span> . <span class=\"hljs-string\">'&lt;br&gt;'<\/span>; <span class=\"hljs-comment\">\/\/ 12<\/span>\n<span class=\"hljs-keyword\">echo<\/span> (int)<span class=\"hljs-number\">12.1<\/span> . <span class=\"hljs-string\">'&lt;br&gt;'<\/span>; <span class=\"hljs-comment\">\/\/ 12<\/span>\n<span class=\"hljs-keyword\">echo<\/span> (int)<span class=\"hljs-number\">12.9<\/span> . <span class=\"hljs-string\">'&lt;br&gt;'<\/span>; <span class=\"hljs-comment\">\/\/ 12<\/span>\n<span class=\"hljs-keyword\">echo<\/span> (int)<span class=\"hljs-number\">-12.9<\/span> . <span class=\"hljs-string\">'&lt;br&gt;'<\/span>; <span class=\"hljs-comment\">\/\/ -12<\/span><\/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><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCmVjaG8gKGludCkxMi41IC4gJzxicj4nOyAvLyAxMgplY2hvIChpbnQpMTIuMSAuICc8YnI-JzsgLy8gMTIKZWNobyAoaW50KTEyLjkgLiAnPGJyPic7IC8vIDEyCmVjaG8gKGludCktMTIuOSAuICc8YnI-JzsgLy8gLTEy\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Suppose you have a string and want to cast it as an integer:<\/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$message = <span class=\"hljs-string\">'Hi'<\/span>;\n$num = (int) $message;\n<span class=\"hljs-keyword\">echo<\/span> $num; <span class=\"hljs-comment\">\/\/ 0<\/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><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAgCgokbWVzc2FnZSA9ICdIaSc7CiRudW0gPSAoaW50KSAkbWVzc2FnZTsKZWNobyAkbnVtOyAvLyAw\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>The result may not be what you expected.<\/p>\n\n\n\n<p>If a string is numeric or leading numeric, then the <code>(int)<\/code> will cast it to the corresponding integer value. Otherwise, the <code>(int)<\/code> cast the string to zero. For example:<\/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$amount =  (int)<span class=\"hljs-string\">'100 USD'<\/span>;\n<span class=\"hljs-keyword\">echo<\/span> $amount; <span class=\"hljs-comment\">\/\/ 100<\/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><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRhbW91bnQgPSAgKGludCknMTAwIFVTRCc7CmVjaG8gJGFtb3VudDsgLy8gMTAw\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>In this example, the <code>(int)<\/code> operator casts the string <code>'100 USD'<\/code> as an integer.<\/p>\n\n\n\n<p>Note that the <code>(int)<\/code> operator casts null to zero (0). For example:<\/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$qty = <span class=\"hljs-keyword\">null<\/span>;\n<span class=\"hljs-keyword\">echo<\/span> (int)$qty; <span class=\"hljs-comment\">\/\/ 0<\/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<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRxdHkgPSBudWxsOwplY2hvIChpbnQpJHF0eTsgLy8gMA\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='cast-to-a-float'>Cast to a float <a href=\"#cast-to-a-float\" class=\"anchor\" id=\"cast-to-a-float\" title=\"Anchor for Cast to a float\">#<\/a><\/h2>\n\n\n\n<p>To cast a value to a <a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-float\/\">float<\/a>, you use the <code>(float)<\/code> operator. For example:<\/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$amount = (float)<span class=\"hljs-number\">100<\/span>;\n<span class=\"hljs-keyword\">echo<\/span> $amount; <span class=\"hljs-comment\">\/\/ 100<\/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><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRhbW91bnQgPSAoZmxvYXQpMTAwOwplY2hvICRhbW91bnQ7IC8vIDEwMA\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='cast-to-a-string'>Cast to a string <a href=\"#cast-to-a-string\" class=\"anchor\" id=\"cast-to-a-string\" title=\"Anchor for Cast to a string\">#<\/a><\/h2>\n\n\n\n<p>To cast a value to a string, you use the <code>(string)<\/code> operator.<\/p>\n\n\n\n<p>The following example uses the <code>(string)<\/code> operator to cast the number 100 to a string:<\/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$amount = <span class=\"hljs-number\">100<\/span>;\n<span class=\"hljs-keyword\">echo<\/span> (string)$amount . <span class=\"hljs-string\">\" USD\"<\/span>; <span class=\"hljs-comment\">\/\/ 100 USD<\/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><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRhbW91bnQgPSAxMDA7CmVjaG8gKHN0cmluZykkYW1vdW50IC4gIiBVU0QiOyAvLyAxMDAgVVNE\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>You don&#8217;t need to use the <code>(string)<\/code> operator in this case because PHP has a feature called type juggling that implicitly converts the integer to a string:<\/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\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$amount = <span class=\"hljs-number\">100<\/span>;\n<span class=\"hljs-keyword\">echo<\/span> $amount . <span class=\"hljs-string\">' USD'<\/span>; <span class=\"hljs-comment\">\/\/ 100 USD<\/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<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRhbW91bnQgPSAxMDA7CmVjaG8gJGFtb3VudCAuICcgVVNEJzsgLy8gMTAwIFVTRA\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>The <code>(string)<\/code> operator converts the <code>true<\/code> value to the string <code>\"1\"<\/code> and <code>false<\/code> value to the empty string (&#8220;&#8221;). 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$is_user_logged_in = <span class=\"hljs-keyword\">true<\/span>;\n<span class=\"hljs-keyword\">echo<\/span> (string)$is_user_logged_in; <span class=\"hljs-comment\">\/\/ 1<\/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><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRpc191c2VyX2xvZ2dlZF9pbiA9IHRydWU7CmVjaG8gKHN0cmluZykkaXNfdXNlcl9sb2dnZWRfaW47IC8vIDE\" 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-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-number\">1<\/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>(string)<\/code> operator casts <code>null<\/code> to an empty string.<\/p>\n\n\n\n<p>The <code>(string)<\/code> cast an array to the <code>\"Array\"<\/code> string. For example:<\/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\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$numbers = &#91;<span class=\"hljs-number\">1<\/span>,<span class=\"hljs-number\">2<\/span>,<span class=\"hljs-number\">3<\/span>];\n$str = (string) $numbers;\n\n<span class=\"hljs-keyword\">echo<\/span> $str; <span class=\"hljs-comment\">\/\/ Array<\/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<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRudW1iZXJzID0gWzEsMiwzXTsKJHN0ciA9IChzdHJpbmcpICRudW1iZXJzOwoKZWNobyAkc3RyOyAvLyBBcnJheQ\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>And you&#8217;ll get a warning that you&#8217;re attempting to convert an array to a string.<\/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\">Warning: <span class=\"hljs-keyword\">Array<\/span> to string conversion in ...<\/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<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>PHP type casting allows you to convert a value from one type to another.<\/li>\n\n\n\n<li>Use a type-casting operator to cast a value to the desired type.<\/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=\"2016\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-type-casting\/\"\n\t\t\t\tdata-post-title=\"PHP Type Casting\"\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=\"2016\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-type-casting\/\"\n\t\t\t\tdata-post-title=\"PHP Type Casting\"\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 about the PHP type casting that allows you to convert a value of a type to another.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":15,"menu_order":15,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2016","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2016","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=2016"}],"version-history":[{"count":5,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2016\/revisions"}],"predecessor-version":[{"id":2968,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/2016\/revisions\/2968"}],"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=2016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}