{"id":228805,"date":"2014-07-05T22:31:03","date_gmt":"2014-07-05T18:31:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=228805"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=228805","title":{"rendered":"<span class=\"post_title\">\u0414\u0435\u043b\u0430\u0435\u043c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u044b<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" align=\"left\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/bd4\/c70\/a34\/bd4c70a34cb38e7f69a7295dedae2fe6.jpg\" alt=\"image\"\/><br \/>  PHP \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 PHP \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u043a \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 json \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043c legasy \u043a\u043e\u0434, \u043d\u0443 \u0430 \u0434\u043b\u044f \u043d\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432\u2026 (\u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u044f) \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <s>\u0433\u043e\u0432\u043d\u043e<\/s>\u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0422\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u043a\u0438\u0439 \u0442\u0440\u044e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\/\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443 \u0442\u043e \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0433\u043b\u0443\u043f\u044b\u043c, \u0430 \u043a\u043e\u043c\u0443 \u0442\u043e \u0434\u0430\u0441\u0442 \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0434\u043b\u044f PHPStorm, \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 IDE \u043d\u0443\u0436\u043d\u043e \u0432\u0430\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0427\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u0430 \u0441 \u043f\u043e\u0442\u043e\u043b\u043a\u0430, \u0447\u0430\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 Instagram api.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.  <\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440\u044b<\/h4>\n<p>  <\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u0440 1. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u044b.<\/h5>\n<p>  \u041c\u044b \u0438\u043c\u0435\u0435\u043c \u0444\u043e\u0440\u043c\u0443:  <\/p>\n<pre><code class=\"html\">&lt;form method=&quot;post&quot; action=&quot;actionurl?route=myroute&quot;&gt;     &lt;label for=&quot;id&quot;&gt;clientID:&lt;\/label&gt;&lt;input id=&quot;id&quot; name=&quot;id&quot; type=&quot;text&quot; value=&quot;6041eee77ac94e6ba83fbcec61ad46c4&quot;&gt;&lt;br&gt;     &lt;label for=&quot;secret&quot;&gt;ClientSecret:&lt;\/label&gt;&lt;input id=&quot;secret&quot; name=&quot;secret&quot; type=&quot;text&quot; value=&quot;539141addd854a8c8d431465d6016590&quot;&gt;&lt;br&gt;     &lt;label for=&quot;tag&quot;&gt;Tag:&lt;\/label&gt;&lt;input id=&quot;tag&quot; name=&quot;tag&quot; type=&quot;text&quot; value=&quot;&quot;&gt;&lt;br&gt;     &lt;input type=&quot;submit&quot; value=&quot;subscribe&quot; name=&quot;subscribe&quot;&gt; | &lt;input type=&quot;submit&quot; value=&quot;unsubscribe&quot; name=&quot;subscribe&quot;&gt; | &lt;input type=&quot;submit&quot; value=&quot;list&quot; name=&quot;subscribe&quot;&gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c $_POST. \u041c\u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u043a\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 (\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u043e\u043f\u0443\u0441\u043a\u0430\u044e)<br \/>  <code>$id = $_POST['id];<\/code><br \/>  \u041a\u0443\u0434\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e IDE \u0438 \u0437\u043d\u0430\u0442\u044c \u0437\u0430 \u0440\u0430\u043d\u0435\u0435 \u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432 \u043d\u0430\u0448\u0435\u043c POST.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u044b:  <\/p>\n<pre><code class=\"php\">\/* @property $id string*\/ \/* @property $secret string *\/ \/* @property $tag string*\/ \/* @property $subscribe string value from MyForm::const*\/ class MyForm extends Post {     const SUBSCRIBE  = 'subscribe';     const UNSUBSCRIBE = 'unsubscribe';     const LIST_ = 'list'; } <\/code><\/pre>\n<p>  \u041d\u0443 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u00ab\u043a\u043b\u0430\u0441\u0441\u0430\u00bb<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/edd\/429\/adb\/edd429adbff4776e807cf5014dfac81a.png\" alt=\"image\"\/><br \/>  \u0421\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u043d\u043e \u0441 \u0447\u0435\u043c \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e.<\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u0440 2. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0441\u0435\u0441\u0441\u0438\u044f\u043c\u0438.<\/h5>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0441\u0435\u0441\u0441\u0438\u044f\u043c\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e.<br \/>  \u041d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441:  <\/p>\n<pre><code class=\"php\">\/* @property $var1 string *\/ \/* @property $var2 string *\/ \/* @property $var3 string *\/ class MySession extends Session{     function __construct()     {         parent::__construct('mySession');     } }  <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0441\u0435\u0441\u0441\u0438\u0439 (\u043a\u043e\u0434 ArrayClass \u0431\u0443\u0434\u0435\u0442 \u0432 \u043a\u043e\u043d\u0446\u0435):  <\/p>\n<pre><code class=\"php\">class Session extends ArrayClass {     function __construct($arrayName = 'session')     {         if(!isset($_SESSION[$arrayName]))             $_SESSION[$arrayName] = array();         parent::__construct($_SESSION[$arrayName]);     }      public static function init(){         session_start();     } } <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a:<br \/>  <code>$s = new MySession(); $s-&gt;var1 = 10;<\/code><br \/>  \u0412\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e.<\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u0440 3. Instagram, json \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b<\/h5>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c API. \u0414\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"php\">$response = file_get_contents(&quot;https:\/\/api.instagram.com\/v1\/tags\/instaprint\/media\/recent?access_token=1413531024.6041eee.200d59e8b9c3448e913ef319f2a26b8a&quot;); $r = new Response(json_decode($response, true));  $body = &quot;Data count = &quot;.$r-&gt;data-&gt;count(); $body.= &quot;\\n&quot;; $tags = $r-&gt;data; $data = new TagData($r-&gt;data-&gt;get(0)); $url = $data-&gt;images-&gt;standard_resolution-&gt;url; $body.= $data-&gt;id; $body.= &quot;Image0 url: &quot;.$url; $body.= '&lt;img src=&quot;'.$url.'&quot;&gt;'; <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u043e\u0432:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0435\u043c\u043d\u043e\u0433\u043e Instagram API<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">\/**  * Class Response  * @package instagram  *  * @property Meta $meta  * @property \\ArrayClass $data  * @property Pagination $pagination  *  *\/ class Response extends \\ArrayClass {     public function getMeta(){         return new Meta($this-&gt;get('meta'));     }      public function getPagination(){         return new Pagination($this-&gt;get('pagination'));     } }  \/**  * Class Meta  * @package instagram  *  * @property integer $code  *\/ class Meta extends \\ArrayClass {  }   \/**  * Class Pagination  * @package instagram  *  * @property integer $next_max_tag_id  * @property integer $next_max_id  * @property integer $next_min_id  * @property string $next_url  *\/ class Pagination extends \\ArrayClass {  }   \/**  * Class TagsData  * @package instagram  *  * @property $attribution  * @property \\ArrayClass $tags  * @property string $type  * @property $location  * @property $comments  * @property $filter  * @property integer $created_time  * @property $link  * @property $likes  * @property Images $images  * @property \\ArrayClass $users_in_photo  * @property Caption $caption  * @property boolean $user_has_liked  * @property integer $id  * @property User $user  *\/ class TagData extends \\ArrayClass {      public function getImages(){         return new Images($this-&gt;get('images'));     }      public function getCaption(){         return new Caption($this-&gt;get('caption'));     }      public function getUser(){         return new User($this-&gt;get('user'));     } }  \/**  * Class Image  * @package instagram  *  * @property Image $low_resolution  * @property Image $thumbnail  * @property Image $standard_resolution  *\/ class Images extends \\ArrayClass {     function __get($name)     {         return new Image($this-&gt;$name);     } }  \/**  * Class Image  * @package instagram  *  * @property string $url  * @property string $width  * @property string $height  *\/ class Image extends \\ArrayClass {  }   \/**  * Class Caption  * @package instagram  *  * @property integer $created_time  * @property string $text  * @property User $from  * @property int $id  *  *\/ class Caption extends \\ArrayClass{     public function getFrom(){         return new User($this-&gt;get('from'));     } }  \/**  * Class From  * @package instagram  *  * @property string $username  * @property string $website  * @property string $profile_picture  * @property integer $id  * @property string $full_name  * @property string $bio  *\/ class User extends \\ArrayClass{  }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 IDE:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/c8e\/f60\/3aa\/c8ef603aadf142f06e435442fc743b44.png\" alt=\"image\"\/><\/p>\n<p>  \u0412 2\u0445 \u0441\u043b\u043e\u0432\u0430\u0445. \u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c json \u043e\u0442 Instagram \u0438 \u0437\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u043d\u0430\u0448\u0438 \u043a\u043b\u0430\u0441\u0441\u044b. \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u043f\u043e\u043c\u043e\u0449\u044c \u043e\u0442 \u043d\u0430\u0448\u0435\u0439 IDE.<\/p>\n<p>  \u041d\u0443 \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c ArrayClass:  <\/p>\n<pre><code class=\"php\">class ArrayClass implements Iterator {     private $array;     \/\/...     \/**      * @param array|ArrayClass|json_string $array      *\/     function __construct(&$array);     \/\/ ...     public function get($index);     \/\/ ...     public function count();     public function ar(){         return $this-&gt;array;     }      public function json(){         return json_encode($this-&gt;array);     } } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 ArrayClass<\/b><\/p>\n<div class=\"spoiler_text\">&lt;?php  <\/p>\n<pre><code class=\"php\">\/**  * Created by PhpStorm.  * User: calc  * Date: 02.07.14  * Time: 0:57  *\/  class ArrayClass implements Iterator {     private $array;     private $haveNext = false;     \/**      * @param array|ArrayClass $array      *\/     function __construct(&$array)     {         if($array === null) $array = array();         if($array instanceof ArrayClass){             $this-&gt;array = &$array-&gt;array;         }         else if(is_string($array)){             $this-&gt;array = json_decode($array, true);         }         else{             $this-&gt;array = &$array;         }          $this-&gt;rewind();     }      function __get($name)     {         return $this-&gt;get($name);     }      function __set($name, $value)     {         $this-&gt;array[$name] = $value;     }      function __isset($name)     {         return isset($this-&gt;array[$name]);     }      function __unset($name)     {         unset($this-&gt;array[$name]);     }      public function get($index){         if(isset($this-&gt;array[$index])){             if(is_array($this-&gt;array[$index])){                 return new ArrayClass($this-&gt;array[$index]);             }             return $this-&gt;array[$index];         }         return null;         \/\/return isset($this-&gt;array[$index]) ? $this-&gt;array[$index] : null;     }      public function count(){         return count($this-&gt;array);     }      public function ar(){         return $this-&gt;array;     }      \/**      * (PHP 5 &gt;= 5.0.0)&lt;br\/&gt;      * Return the current element      * @link http:\/\/php.net\/manual\/en\/iterator.current.php      * @return mixed Can return any type.      *\/     public function current()     {         return current($this-&gt;array);     }      \/**      * (PHP 5 &gt;= 5.0.0)&lt;br\/&gt;      * Move forward to next element      * @link http:\/\/php.net\/manual\/en\/iterator.next.php      * @return void Any returned value is ignored.      *\/     public function next()     {         $this-&gt;haveNext = next($this-&gt;array);     }      \/**      * (PHP 5 &gt;= 5.0.0)&lt;br\/&gt;      * Return the key of the current element      * @link http:\/\/php.net\/manual\/en\/iterator.key.php      * @return mixed scalar on success, or null on failure.      *\/     public function key()     {         return key($this-&gt;array);     }      \/**      * (PHP 5 &gt;= 5.0.0)&lt;br\/&gt;      * Checks if current position is valid      * @link http:\/\/php.net\/manual\/en\/iterator.valid.php      * @return boolean The return value will be casted to boolean and then evaluated.      * Returns true on success or false on failure.      *\/     public function valid()     {         return $this-&gt;haveNext;     }      \/**      * (PHP 5 &gt;= 5.0.0)&lt;br\/&gt;      * Rewind the Iterator to the first element      * @link http:\/\/php.net\/manual\/en\/iterator.rewind.php      * @return void Any returned value is ignored.      *\/     public function rewind()     {         $this-&gt;haveNext = $this-&gt;array === array() ? false : true;         reset($this-&gt;array);     }      public function json(){         return json_encode($this-&gt;array);     } }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0438 \u0434\u0430\u0435\u043c \u044d\u0442\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u0435 \u043f\u0430\u0440\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439  <\/p>\n<ul>\n<li>\u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (\u0434\u0430\u0436\u0435 \u0438\u0437 $_POST, $_GET \u0438 \u0442.\u0434), \u0438\u0437 \u0441\u0435\u0431\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e ArrayObject, \u0438\u0437 json \u0441\u0442\u0440\u043e\u043a\u0438<\/li>\n<li>\u043c\u0435\u0442\u043e\u0434 get \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u043a\u043b\u044e\u0447\u0443, \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (0..n), \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0435 for($i) $a-&gt;get($i), \u0434\u043b\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0438.<\/li>\n<li>\u041d\u0443 json() \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 json<\/li>\n<\/ul>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/158\/720\/543\/15872054385f34e64c069cef05f9ecea.png\" alt=\"image\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b.<br \/>  \u041f\u043b\u044e\u0441\u044b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0447\u0435\u0440\u0435\u0437 \u0433\u043e\u0434 \u0437\u0430\u043b\u0435\u0437\u0435\u0442\u0435 \u0432 \u0441\u0432\u043e\u0439 \u0438\u043b\u0438 \u0447\u0443\u0436\u043e\u0439 \u043a\u043e\u0434 IDE \u0432\u0430\u043c \u0434\u0430\u0441\u0442 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443 \u0438 \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u0447\u0442\u043e \u0437\u0430 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0432 $_GET[&#8216;magic&#8217;] \u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u0445 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e \u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0441\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0448\u0443 \u043e\u0442\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0421\u043f\u0430\u0441\u0438\u0431\u043e.      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/228805\/\"> http:\/\/habrahabr.ru\/post\/228805\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t<img decoding=\"async\" align=\"left\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/bd4\/c70\/a34\/bd4c70a34cb38e7f69a7295dedae2fe6.jpg\" alt=\"image\"\/><br \/>  PHP \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u2014 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 PHP \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u0430\u043a \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043b\u0435\u0433\u043a\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041f\u043e\u043d\u044f\u0442\u043d\u043e \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u0439 json \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043c legasy \u043a\u043e\u0434, \u043d\u0443 \u0430 \u0434\u043b\u044f \u043d\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432\u2026 (\u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u044f) \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c <s>\u0433\u043e\u0432\u043d\u043e<\/s>\u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0422\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0435\u043a\u0438\u0439 \u0442\u0440\u044e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\/\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443 \u0442\u043e \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0433\u043b\u0443\u043f\u044b\u043c, \u0430 \u043a\u043e\u043c\u0443 \u0442\u043e \u0434\u0430\u0441\u0442 \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0434\u043b\u044f PHPStorm, \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 IDE \u043d\u0443\u0436\u043d\u043e \u0432\u0430\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c.  <\/p>\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-228805","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/228805","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=228805"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/228805\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=228805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=228805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=228805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}