{"id":49722,"date":"2018-09-17T19:19:35","date_gmt":"2018-09-17T13:19:35","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=49722"},"modified":"2018-09-17T19:19:35","modified_gmt":"2018-09-17T13:19:35","slug":"%d0%ba%d0%be%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%ba%d1%86%d0%b8%d1%8f-if","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=49722","title":{"rendered":"\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f if"},"content":{"rendered":"<p>\u0415\u0441\u043b\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e (true), \u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 if \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d, \u0430 \u0435\u0441\u043b\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043b\u043e\u0436\u043d\u043e (false), \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 if \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre class=\"php\" style=\"font-family: monospace; font-size: 12px;\"><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">==<\/span> <span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #009900;\">)<\/span>\r\n<span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #000088;\">$a<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ \u0432\u044b\u0432\u0435\u0434\u0435\u0442 5<\/span><\/pre>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u043a\u043e\u0434 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u0431\u043b\u043e\u043a {}:<\/p>\n<pre class=\"php\" style=\"font-family: monospace; font-size: 12px;\"><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">==<\/span> <span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #000088;\">$a<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043b\u043e\u0436\u043d\u043e:<\/p>\n<pre class=\"php\" style=\"font-family: monospace; font-size: 12px;\"><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">&gt;=<\/span> <span style=\"color: #cc66cc;\">10<\/span><span style=\"color: #009900;\">)<\/span> <span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #000088;\">$a<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span>\r\n<span style=\"color: #b1b100;\">else<\/span> <span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"a \u043c\u0435\u043d\u044c\u0448\u0435 10\"<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ \u0432\u044b\u0432\u0435\u0434\u0435\u0442 - a \u043c\u0435\u043d\u044c\u0448\u0435 10<\/span><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 if \u0432 \u0446\u0438\u043a\u043b\u0435 for:<\/p>\n<pre class=\"php\" style=\"font-family: monospace; font-size: 12px;\"><span style=\"color: #b1b100;\">for<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">&lt;=<\/span><span style=\"color: #cc66cc;\">100<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">++<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #009900;\">{<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u0447\u0435\u0442\u043d\u044b\u0435<\/span>\r\n<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color: #800080;\">2<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span>\r\n<span style=\"color: #009900;\">}<\/span><\/pre>\n<blockquote><p>13579111315171921232527293133353739414345474951535557596163656769717375777981838587899193959799<\/p><\/blockquote>\n<p>\u0438\u043b\u0438 \u0442\u0430\u043a:<\/p>\n<pre class=\"php\" style=\"font-family: monospace; font-size: 12px;\"><span style=\"color: #b1b100;\">for<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">&lt;=<\/span><span style=\"color: #cc66cc;\">100<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">++<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #009900;\">{<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u0447\u0435\u0442\u043d\u044b\u0435<\/span>\r\n<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color: #800080;\">2<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #000088;\">$i<\/span><span style=\"color: #339933;\">.<\/span><span style=\"color: #0000ff;\">\" \"<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span>\r\n<span style=\"color: #009900;\">}<\/span><\/pre>\n<blockquote><p>1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99<\/p><\/blockquote>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439:<\/p>\n<pre class=\"php\" style=\"font-family: monospace; font-size: 12px;\"><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #000088;\">$b<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #cc66cc;\">6<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">&gt;<\/span> <span style=\"color: #000088;\">$b<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0431\"<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span>\r\n<span style=\"color: #b1b100;\">elseif<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">==<\/span> <span style=\"color: #000088;\">$b<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"\u0430 \u0440\u0430\u0432\u043d\u043e \u0431\"<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span>\r\n<span style=\"color: #b1b100;\">else<\/span> <span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u0431\"<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span><\/pre>\n<blockquote><p>\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u0431<\/p><\/blockquote>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 if:<\/p>\n<pre class=\"php\" style=\"font-family: monospace; font-size: 12px;\"><span style=\"color: #000088;\">$a<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #cc66cc;\">5<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #000088;\">$b<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #cc66cc;\">6<\/span><span style=\"color: #339933;\">;<\/span>\r\n<span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">(<\/span><span style=\"color: #000088;\">$a<\/span> <span style=\"color: #339933;\">&gt;=<\/span> <span style=\"color: #cc66cc;\">5<\/span> and <span style=\"color: #000088;\">$b<\/span> <span style=\"color: #339933;\">&gt;=<\/span> <span style=\"color: #000088;\">$b<\/span><span style=\"color: #009900;\">)<\/span><span style=\"color: #009900;\">{<\/span><span style=\"color: #b1b100;\">echo<\/span> <span style=\"color: #0000ff;\">\"\u0430 \u0438 \u0431 \u0431\u043e\u043b\u044c\u0448\u0435 5\"<\/span><span style=\"color: #339933;\">;<\/span><span style=\"color: #009900;\">}<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0415\u0441\u043b\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e (true), \u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 if \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d, \u0430 \u0435\u0441\u043b\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043b\u043e\u0436\u043d\u043e (false), \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430 if \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f: $a = 5; if($a == 5) echo $a; \/\/ \u0432\u044b\u0432\u0435\u0434\u0435\u0442 5 \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u043a\u043e\u0434 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u0431\u043b\u043e\u043a {}: $a = 5; if($a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":49675,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[183],"tags":[],"class_list":["post-49722","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"views":1562,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/49722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=49722"}],"version-history":[{"count":1,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/49722\/revisions"}],"predecessor-version":[{"id":49723,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/49722\/revisions\/49723"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/49675"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=49722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=49722"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=49722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}