{"id":257766,"date":"2015-05-22T15:51:01","date_gmt":"2015-05-22T11:51:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=257766"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=257766","title":{"rendered":"\u0412\u044b\u0434\u0438\u0440\u0430\u0435\u043c sms \u0438\u0437 GOIP \u043d\u0430 PHP"},"content":{"rendered":"<p>     \t\u0414\u0430, \u0410\u0441\u0442\u0435\u0440\u0438\u0441\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e \u2014 \u043c\u0435\u0442\u043e\u0434 (\u0438 \u0441\u043a\u0440\u0438\u043f\u0442) \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043d\u0435\u0433\u043e, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447. \u041d\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0445\u0430\u0431\u0430 \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u2014 \u0443\u043a\u0430\u0436\u0438\u0442\u0435, \u043f\u043e\u043f\u0440\u0430\u0432\u043b\u044e. \u0421\u043f\u0430\u0441\u0438\u0431\u043e!<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0438\u043c\u0435\u0435\u043c GOIP \u2014 GSM \u0448\u043b\u044e\u0437. \u041a \u043d\u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c SMS-\u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u043e \u044f \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0430 vds, \u0434\u0430 \u0438 \u043e\u043d \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d (\u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b) \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0448\u043b\u044e\u0437\u0430\u043c\u0438 \u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0443 \u043d\u0430\u0441 \u043e\u0434\u0438\u043d-\u0434\u0432\u0430 \u0448\u043b\u044e\u0437\u0430, \u0438 \u0441\u043c\u0441 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u0438\u0434\u0435\u0442\u044c \u00ab\u043f\u043e\u0441\u0442\u043e\u043b\u044c\u043a\u0443 \u2014 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443\u00bb \u2014 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043c\u044b\u0441\u043b.<\/p>\n<p>  \u0412 \u0432\u0435\u0431\u043c\u043e\u0440\u0434\u0435 \u0448\u043b\u044e\u0437\u0430 sms-\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00abTools\u00bb =&gt; \u00abSMS in box\u00bb. \u0414\u0430 \u0434\u0430, \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435 \u043a\u043e \u043c\u043d\u0435 \u2014 \u043a \u043a\u0438\u0442\u0430\u0439\u0446\u0430\u043c \ud83d\ude42<br \/>  \u0428\u043b\u044e\u0437 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u043e 5 \u0441\u043c\u0441 \u043d\u0430 \u043a\u0430\u043d\u0430\u043b.<br \/>  \u041e\u0442\u0442\u0443\u0434\u0430 \u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0432\u044b\u0434\u0438\u0440\u0430\u0442\u044c, \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043d\u0430 PHP. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0435.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<pre><code class=\"php\">&lt;?php \/*  \u041f\u0440\u0438\u0435\u043c SMS \u0438\u0437 GOIP     whoim, whoim@mail.ru *\/  $goip_addr = &quot;http:\/\/goip_external_ip:7454\/&quot;; #\u0412\u043d\u0435\u0448\u043d\u0438\u0439 (\u0435\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442) \u0430\u0434\u0440\u0435\u0441 goip. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u0440\u0442 \u043d\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 7454 =&gt; local_goip_addr:80 $goip_user = &quot;admin&quot;; $goip_password = &quot;goip-password&quot;;  #\u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 goip-\u0435 $context = stream_context_create(array(     'http' =&gt; array(         'header'  =&gt; &quot;Authorization: Basic &quot; . base64_encode(&quot;$goip_user:$goip_password&quot;)     ) )); #\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u044b\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 - html $data = file_get_contents($goip_addr.&quot;\/default\/en_US\/tools.html?type=sms_inbox&quot;, false, $context); #\u0443 \u043c\u0435\u043d\u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u0435 \u043a\u043e\u0441\u044f\u043a\u0438, \u043f\u0440\u0430\u0432\u0438\u043c $data = str_replace('\\&quot;', '&quot;', $data); \/\/fix #\u0432\u044b\u0434\u0438\u0440\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 sms \u0438\u0437 js-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 html, \u043a\u043b\u044e\u0447 = \u043a\u0430\u043d\u0430\u043b\u0443 sim preg_match_all(&quot;|sms= \\[(.*?)\\]|is&quot;, $data, $sms_dump_arr);   $sms = array(); #\u043f\u0435\u0440\u0432\u044b\u0439 \u0446\u0438\u043a\u043b - \u043f\u043e &quot;\u043a\u0430\u043d\u0430\u043b\u0430\u043c sim&quot;, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 5 \u0441\u043c\u0441-\u043e\u043a, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0438 \u0432 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445. \u0422\u043e \u0435\u0441\u0442\u044c \u0432 csv. #\u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e str_getcsv \u0434\u043e\u0431\u044b\u0432\u0430\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0436\u0435 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u043c\u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u043e. foreach($sms_dump_arr[1] as $sim_key =&gt; $sim_val)    foreach(str_getcsv($sim_val) as $sms_key =&gt; $sms_val) {       $sms[$sim_key][$sms_key] = explode(',', $sms_val, 3); #\u043a\u043b\u044e\u0447\u0438 0,1,2 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0434\u0430\u0442\u0443\u0432\u0440\u0435\u043c\u044f, \u043d\u043e\u043c\u0435\u0440, \u0442\u0435\u043a\u0441\u0442 \u0441\u043c\u0441.       $sms[$sim_key][$sms_key][] = md5($sms_val); #\u043a\u043b\u044e\u0447 3 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0445\u0435\u0448 \u043f\u0435\u0440\u0432\u044b\u0445 \u0442\u0440\u0435\u0445, \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 sms-\u043a\u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c       }  #\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 print_r($sms); ?&gt; <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0430. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u2014 \u0412\u0430\u0448\u0435 \u0434\u0435\u043b\u043e. \u042f \u0431\u0443\u0434\u0443 \u0441\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u043e \u0445\u0435\u0448\u0443, \u043d\u0435\u0442 \u043b\u0438 \u0435\u0435 \u0435\u0449\u0435 \u0432 \u0431\u0430\u0437\u0435, \u0438 \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u2014 \u043a\u043b\u0430\u0441\u0442\u044c \u0432 mysql \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0443. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u0438\u0431\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 5 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0441\u043c\u0441, \u0442\u043e \u0435\u0441\u0442\u044c \u2014 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0443\u0442, \u0441\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0423\u0434\u0430\u0447\u0438!     \t<\/p>\n<div class=\"clear\"><\/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\/258561\/\"> http:\/\/habrahabr.ru\/post\/258561\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u0414\u0430, \u0410\u0441\u0442\u0435\u0440\u0438\u0441\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e \u2014 \u043c\u0435\u0442\u043e\u0434 (\u0438 \u0441\u043a\u0440\u0438\u043f\u0442) \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u043d\u0435\u0433\u043e, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447. \u041d\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0445\u0430\u0431\u0430 \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u2014 \u0443\u043a\u0430\u0436\u0438\u0442\u0435, \u043f\u043e\u043f\u0440\u0430\u0432\u043b\u044e. \u0421\u043f\u0430\u0441\u0438\u0431\u043e!<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0438\u043c\u0435\u0435\u043c GOIP \u2014 GSM \u0448\u043b\u044e\u0437. \u041a \u043d\u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c SMS-\u0441\u0435\u0440\u0432\u0435\u0440, \u043d\u043e \u044f \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043d\u0430 vds, \u0434\u0430 \u0438 \u043e\u043d \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d (\u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b) \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0448\u043b\u044e\u0437\u0430\u043c\u0438 \u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0443 \u043d\u0430\u0441 \u043e\u0434\u0438\u043d-\u0434\u0432\u0430 \u0448\u043b\u044e\u0437\u0430, \u0438 \u0441\u043c\u0441 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u0438\u0434\u0435\u0442\u044c \u00ab\u043f\u043e\u0441\u0442\u043e\u043b\u044c\u043a\u0443 \u2014 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443\u00bb \u2014 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043c\u044b\u0441\u043b.<\/p>\n<p>  \u0412 \u0432\u0435\u0431\u043c\u043e\u0440\u0434\u0435 \u0448\u043b\u044e\u0437\u0430 sms-\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00abTools\u00bb =&gt; \u00abSMS in box\u00bb. \u0414\u0430 \u0434\u0430, \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435 \u043a\u043e \u043c\u043d\u0435 \u2014 \u043a \u043a\u0438\u0442\u0430\u0439\u0446\u0430\u043c \ud83d\ude42<br \/>  \u0428\u043b\u044e\u0437 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u043e 5 \u0441\u043c\u0441 \u043d\u0430 \u043a\u0430\u043d\u0430\u043b.<br \/>  \u041e\u0442\u0442\u0443\u0434\u0430 \u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0432\u044b\u0434\u0438\u0440\u0430\u0442\u044c, \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043d\u0430 PHP. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0435.  <\/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-257766","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/257766","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=257766"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/257766\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}