{"id":296950,"date":"2020-01-10T15:00:08","date_gmt":"2020-01-10T15:00:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296950"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-01-10T15:00:08","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296950","title":{"rendered":"\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 json_encode (PHP)"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/483492\/\">\n<p> \u042d\u0442\u043e \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 <i>json_encode<\/i> \u0438 \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445. \u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u00a0json, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<i>json_encode<\/i>\u00a0\u0432\u00a0php, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0435 \u0442\u043e\u0442\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0436\u0438\u0434\u0430\u0435\u043c. \u042f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0442\u0440\u0438\u00a0\u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435\u00a0\u0447\u0430\u0441\u0442\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b\u00a0\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438\u00a0\u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b:  <\/p>\n<p>  <\/p>\n<ul>\n<li> \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u044f\u043c<\/li>\n<li> \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/li>\n<li> \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3>\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u044f\u043c<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u0447\u0442\u043e <i>json_encode<\/i> \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u043e\u043b\u044f\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">class Example {     public $publicProperty;     protected $protectedProperty;     private $privateProperty;      public function __construct($public, $protected, $private)     {         $this-&gt;publicProperty = $public;         $this-&gt;protectedProperty = $protected;         $this-&gt;privateProperty = $private;     } } <\/code><\/pre>\n<p>  <\/p>\n<p>\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$obj = new Example(&quot;some&quot;, &quot;value&quot;, &quot;here&quot;);  echo json_encode($obj);  \/\/ {&quot;publicProperty&quot;:&quot;some&quot;} <\/code><\/pre>\n<p>  <\/p>\n<p>\u043a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 json \u0431\u044b\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u044f.<br \/>  \u0427\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u044b \u0432\u0441\u0435 \u043f\u043e\u043b\u044f?<\/p>\n<p>  <\/p>\n<h4>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h4>\n<p>  <\/p>\n<p>\u0414\u043b\u044f php &lt; 5.4:<br \/>  \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 json. \u0422.\u043a. \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u0441\u0435\u043c \u043f\u043e\u043b\u044f\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0434\u043b\u044f\u00a0 <i>json_encode<\/i><\/p>\n<p>  <\/p>\n<pre><code class=\"php\">class Example {     public $publicProperty;     protected $protectedProperty;     private $privateProperty;      public function __construct($public, $protected, $private)     {         $this-&gt;publicProperty = $public;         $this-&gt;protectedProperty = $protected;         $this-&gt;privateProperty = $private;     }      public function toJson()     {         return json_encode([             'publicProperty' =&gt; $this-&gt;publicProperty,             'protectedProperty' =&gt; $this-&gt;protectedProperty,             'privateProperty' =&gt; $this-&gt;privateProperty,         ]);     } } <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 json-a c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <b>toJson<\/b>, \u0430 \u043d\u0435 \u043f\u0440\u044f\u043c\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c <i>json_encode<\/i> \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$obj = new Example(&quot;some&quot;, &quot;value&quot;, &quot;here&quot;);  echo $obj-&gt;toJson(); <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f php &gt;= 5.4:<br \/>  \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <b>JsonSerializable<\/b> \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <b>jsonSerialize<\/b> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043b\u044f <i>json_encode<\/i><\/p>\n<p>  <\/p>\n<pre><code class=\"php\">class Example implements JsonSerializable {     public $publicProperty;     protected $protectedProperty;     private $privateProperty;      public function __construct($public, $protected, $private)     {         $this-&gt;publicProperty = $public;         $this-&gt;protectedProperty = $protected;         $this-&gt;privateProperty = $private;     }      public function jsonSerialize()      {         return [             'publicProperty' =&gt; $this-&gt;publicProperty,             'protectedProperty' =&gt; $this-&gt;protectedProperty,             'privateProperty' =&gt; $this-&gt;privateProperty,         ];     } } <\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <i>json_encode<\/i> \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u044c\u0448\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$obj = new Example(&quot;some&quot;, &quot;value&quot;, &quot;here&quot;);  echo json_encode($obj);  \/\/ {&quot;publicProperty&quot;:&quot;some&quot;,&quot;protectedProperty&quot;:&quot;value&quot;,&quot;privateProperty&quot;:&quot;here&quot;} <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 toJson \u043c\u0435\u0442\u043e\u0434\u043e\u043c?<\/h4>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0447\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0433\u043e json \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0438 \u0432 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 php &gt;= 5.4. \u0422\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c? \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0432\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0438\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 <\/p>\n<p>  <\/p>\n<pre><code class=\"php\">echo json_encode([     'status' =&gt; true,     'message' =&gt; 'some message',     'data' =&gt; new Example(&quot;some&quot;, &quot;value&quot;, &quot;here&quot;), ]); <\/code><\/pre>\n<p>  <\/p>\n<p>\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430\u043c\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0430\u043a\u043e\u0439 \u0442\u0438\u043f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 json-\u0430 \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d.  <\/p>\n<h4>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u043c\u0435\u043d\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0439 \u0432 \u043a\u043b\u0430\u0441c\u0435?<\/h4>\n<p>  <\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 get_object_vars<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">class Example implements JsonSerializable {     public $publicProperty;     protected $protectedProperty;     private $privateProperty;     protected $someProp1; ...     protected $someProp100500;      public function __construct($public, $protected, $private)     {         $this-&gt;publicProperty = $public;         $this-&gt;protectedProperty = $protected;         $this-&gt;privateProperty = $private;     }      public function jsonSerialize()      {         $fields = get_object_vars($this);         \/\/ \u0447\u0442\u043e-\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c ...         return $fields;     } } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0410 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e private \u043f\u043e\u043b\u044f \u0441 \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c?<\/h4>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <b>private<\/b> \u043f\u043e\u043b\u044f (\u0438\u043c\u0435\u043d\u043d\u043e <b>private<\/b>, \u0442.\u043a. \u0434\u043e\u0441\u0442\u0443\u043f \u043a <b>protected<\/b> \u043f\u043e\u043b\u044f\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435) \u0432 json-\u0435. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0435\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">class Example {     public $publicProperty = &quot;someValue&quot;;     protected $protectedProperty;     private $privateProperty1;     private $privateProperty2;     private $privateProperty3;      public function __construct($privateProperty1, $privateProperty2, $privateProperty3, $protectedProperty)     {         $this-&gt;protectedProperty = $protectedProperty;         $this-&gt;privateProperty1 = $privateProperty1;         $this-&gt;privateProperty2 = $privateProperty2;         $this-&gt;privateProperty3 = $privateProperty3;     } }  $obj = new Example(&quot;value1&quot;, 12, &quot;21E021&quot;, false); $reflection = new ReflectionClass($obj);  $public = [];  foreach ($reflection-&gt;getProperties() as $property) {     $property-&gt;setAccessible(true);     $public[$property-&gt;getName()] = $property-&gt;getValue($obj); }  echo json_encode($public);  \/\/{&quot;publicProperty&quot;:&quot;someValue&quot;,&quot;protectedProperty&quot;:false,&quot;privateProperty1&quot;:&quot;value1&quot;,&quot;privateProperty2&quot;:12,&quot;privateProperty3&quot;:&quot;21E021&quot;} <\/code><\/pre>\n<p>  <\/p>\n<h3>\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/h3>\n<p>  <\/p>\n<h4>\u041a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u043d\u0430\u043a\u0438 \u0432 UTF8<\/h4>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0442\u0438\u043f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 <i>json_encode<\/i> \u044d\u0442\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u043e\u0439. \u0427\u0430\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 json \u0438\u043c\u0435\u044e\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 UTF8 (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0430) \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">echo json_encode(&quot;\u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0430 or \u20b3 \u0192 \u5143 \ufdfc \u20a8 \u0bf9 \uffe5 \u20b4 \uffe1 \u0e3f \uff04&quot;);  \/\/ &quot;\\u043a\\u0438\\u0440\\u0438\\u043b\\u0438\\u0446\\u0430 or \\u20b3 \\u0192 \\u5143 \\ufdfc \\u20a8 \\u0bf9 \\uffe5 \\u20b4 \\uffe1 \\u0e3f \\uff04&quot; <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043b\u0435\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u043b\u0430\u0433\u0430 <b>JSON_UNESCAPED_UNICODE<\/b> \u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>json_encode<\/i>:  <\/p>\n<p>  <\/p>\n<pre><code class=\"php\">echo json_encode(&quot;\u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0430 or \u20b3 \u0192 \u5143 \ufdfc \u20a8 \u0bf9 \uffe5 \u20b4 \uffe1 \u0e3f \uff04&quot;, JSON_UNESCAPED_UNICODE); \/\/ &quot;\u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0430 or \u20b3 \u0192 \u5143 \ufdfc \u20a8 \u0bf9 \uffe5 \u20b4 \uffe1 \u0e3f \uff04&quot; <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0421\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430\u0445<\/h3>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <i>json_encode<\/i> \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 UTF8, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u0435\u0441\u043b\u0438 \u043a\u043e\u0434\u0435\u0440\u043e\u0432\u043a\u0430 \u0434\u0440\u0443\u0433\u0430\u044f. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u0443\u0441\u043e\u0447\u0435\u043a \u043a\u043e\u0434\u0430 (\u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0435\u043d \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438)<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">echo json_encode([&quot;p&quot; =&gt; $_GET['p']]); <\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0435\u0449\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0434\u0430 \u0438 \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0439\u0442\u0438 \u043d\u0435 \u0442\u0430\u043a? \u042f \u0442\u043e\u0436\u0435 \u0442\u0430\u043a \u0434\u0443\u043c\u0430\u043b. \u0412 \u043f\u043e\u0434\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438 \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0437\u0430\u043d\u044f\u043b \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0435\u043c \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c <i>json_encode<\/i> \u0431\u044b\u043b\u043e false.  <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0432\u043e\u0441\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0447\u0442\u043e p=<b>%EF%F2%E8%F6%E0<\/b> (\u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440: <a href=\"http:\/\/localhost?=%EF%F2%E8%F6%E0\">localhost?=%EF%F2%E8%F6%E0<\/a> ). <br \/>  *\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0443\u043f\u0435\u0440\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445\u00a0$_GET\u00a0\u0438\u00a0$_REQUEST\u00a0\u0443\u0436\u0435 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u044b.   <\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$decoded = urldecode(&quot;%EF%F2%E8%F6%E0&quot;);  var_dump(json_encode($decoded)); \/\/ bool(false)  var_dump(json_last_error_msg()); \/\/ string(56) &quot;Malformed UTF-8 characters, possibly incorrectly encoded&quot; <\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0438\u0437 \u043e\u0448\u0438\u0431\u043a\u0438: \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (\u044d\u0442\u043e \u043d\u0435 UTF8). \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u2014 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 UTF8<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$decoded = urldecode(&quot;%EF%F2%E8%F6%E0&quot;); $utf8 = utf8_encode($decoded);  echo json_encode($utf8); \/\/ &quot;\u00ef\u00f2\u00e8\u00f6\u00e0&quot; <\/code><\/pre>\n<p>  <\/p>\n<h2>\u0426\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0442\u0438\u043f\u043e\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">echo json_encode([&quot;string_float&quot; =&gt; &quot;3.0&quot;]); \/\/ {&quot;string_float&quot;:&quot;3.0&quot;} <\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e php \u043d\u0435 \u0441\u0442\u0440\u043e\u0433\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438, \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0432\u043d\u0443\u0442\u0440\u0438 php \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a json \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0438\u0441\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0416\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <b>JSON_NUMERIC_CHECK<\/b>:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">echo json_encode([&quot;string_float&quot; =&gt; &quot;3.0&quot;], JSON_NUMERIC_CHECK); \/\/ {&quot;string_float&quot;:3} <\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0436\u0435 \u043b\u0443\u0447\u0448\u0435. \u041d\u043e \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u043c \u00ab3.0\u00bb \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u043e\u0441\u044c \u0432 3, \u0447\u0442\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043a\u0430\u043a int. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0444\u043b\u0430\u0433 <b>JSON_PRESERVE_ZERO_FRACTION<\/b> \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 float:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">echo json_encode([&quot;string_float&quot; =&gt; &quot;3.0&quot;], JSON_NUMERIC_CHECK | JSON_PRESERVE_ZERO_FRACTION); \/\/ {&quot;string_float&quot;:3.0} <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0448\u0443 \u0442\u0430\u043a \u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0440\u044f\u0434 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 <i>json_encode<\/i> \u0438 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"php\">$data = [     &quot;0000021&quot;, \/\/ \u043d\u0443\u043b\u0438 \u0441\u043b\u0435\u0432\u0430     6.12345678910111213, \/\/ \u043c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0447\u043a\u0438 (\u0431\u0443\u0434\u0435\u0442 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u043e)     &quot;+81011321515&quot;, \/\/ \u0442\u0435\u043b\u0435\u0444\u043e\u043d     &quot;21E021&quot;, \/\/ \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c ];  echo json_encode($data, JSON_NUMERIC_CHECK); \/\/[ \/\/    21, \/\/    6.1234567891011, \/\/    81011321515, \/\/    2.1e+22 \/\/ ] <\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u00a0\u043f\u0440\u043e\u0431\u043b\u0435\u043c,\u00a0\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0432\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u043d\u0435 \u0431\u044b\u043b\u0438 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435<\/p>\n<p>\u00a0<\/p><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/483492\/\"> https:\/\/habr.com\/ru\/post\/483492\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/483492\/\">\n<p> \u042d\u0442\u043e \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 <i>json_encode<\/i> \u0438 \u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u0445. \u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u00a0json, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u00a0<i>json_encode<\/i>\u00a0\u0432\u00a0php, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0435 \u0442\u043e\u0442\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0436\u0438\u0434\u0430\u0435\u043c. \u042f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0442\u0440\u0438\u00a0\u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435\u00a0\u0447\u0430\u0441\u0442\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b\u00a0\u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438\u00a0\u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b:  <\/p>\n<p>  <\/p>\n<ul>\n<li> \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u044f\u043c<\/li>\n<li> \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/li>\n<li> \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-296950","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=296950"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296950\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}