{"id":2568,"date":"2021-07-19T12:40:42","date_gmt":"2021-07-19T12:40:42","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=2568"},"modified":"2021-07-19T12:40:43","modified_gmt":"2021-07-19T12:40:43","slug":"6-uslovnye-konstrukczii-if-else-logicheskie-operatory","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/en\/6-uslovnye-konstrukczii-if-else-logicheskie-operatory\/","title":{"rendered":"#6 \u2013 \u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 (if-else). \u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043a\u043e\u0434. \u0412 \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u00abif &#8211; else\u00bb \u0438 \u0438\u0437\u0443\u0447\u0438\u043c \u0432\u0441\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u0412\u0438\u0434\u0435\u043e\u0443\u0440\u043e\u043a<\/h3>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"\u0423\u0440\u043e\u043a\u0438 PHP \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \/ #6 \u2013 \u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/-m3d9H__xxM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418\u0445 \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442 \u0432 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c. \u041a\u0430\u0436\u0434\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u0438\u0431\u043e 0 (<strong>false<\/strong>), \u043b\u0438\u0431\u043e 1 (<strong>true<\/strong>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u044b:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>$a == $b<\/code>&nbsp;&#8211; \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e (\u0435\u0441\u043b\u0438 \u0430 \u0440\u0430\u0432\u043d\u043e b);<\/li><li><code>$a != $b<\/code>&nbsp;&#8211; \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e (\u0435\u0441\u043b\u0438 \u0430&nbsp;<strong>\u043d\u0435<\/strong>&nbsp;\u0440\u0430\u0432\u043d\u043e b);<\/li><li><code>$a &gt; $b<\/code>&nbsp;&#8211; \u0431\u043e\u043b\u044c\u0448\u0435 (\u0435\u0441\u043b\u0438 \u0430 \u0431\u043e\u043b\u044c\u0448\u0435 b);<\/li><li><code>$a &lt; $b<\/code>&nbsp;&#8211; \u043c\u0435\u043d\u044c\u0448\u0435 (\u0435\u0441\u043b\u0438 \u0430 \u043c\u0435\u043d\u044c\u0448\u0435 b);<\/li><li><code>$a &gt;= $b<\/code>&nbsp;&#8211; \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e (\u0435\u0441\u043b\u0438 \u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e b);<\/li><li><code>$a &lt;= $b<\/code>&nbsp;&#8211; \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e (\u0435\u0441\u043b\u0438 \u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e b);<\/li><li><code>!$a<\/code>&nbsp;&#8211; \u043b\u043e\u0436\u044c (\u0435\u0441\u043b\u0438 a \u0440\u0430\u0432\u043d\u043e false);<\/li><li><code>$a<\/code>&nbsp;&#8211; \u0438\u0441\u0442\u0438\u043d\u043d\u0430 (\u0435\u0441\u043b\u0438 a \u0440\u0430\u0432\u043d\u043e true).&nbsp;<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c &#8220;\u0438&#8221; \u0438\u043b\u0438 \u0436\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c &#8220;\u0438\u043b\u0438&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u0415\u0441\u043b\u0438 \u0438 \u043f\u0435\u0440\u0432\u043e\u0435, \u0438 \u0432\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0435\u0440\u043d\u044b\u0435,\n\/\/ \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 true\n$a != $b &amp;&amp; $a &gt; $b\n\/\/ \u0415\u0441\u043b\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0432\u043e\u0435, \u0438\u043b\u0438 \u0432\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0435\u0440\u043d\u044b\u0435,\n\/\/ \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 true\n$a &lt; $b || $a == $b<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412&nbsp;<strong>PHP<\/strong>&nbsp;\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u0440\u043e\u0439\u043d\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 &#8211;&nbsp;<code>===<\/code>. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0442 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u043e\u0431\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442&nbsp;<strong>true<\/strong>, \u0438\u043d\u0430\u0447\u0435 \u2013&nbsp;<strong>false<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b, \u0432\u0435\u0434\u044c \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u0412 \u044f\u0437\u044b\u043a\u0435 PHP \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0440\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443. \u0421\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0432\u0435 \u0438\u0437 \u043d\u0438\u0445.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f if &#8211; else<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430 \u0441\u0447\u0451\u0442&nbsp;if else&nbsp;\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0434\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0445 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043e\u0434\u0438\u043d, \u0438\u043d\u0430\u0447\u0435 \u0434\u0440\u0443\u0433\u043e\u0439.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$a = 2;\n$b = 10;\nif ($a == $b) { \/\/ \u0415\u0441\u043b\u0438 $a \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u044b\u043c $b, \u0442\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043a\u043e\u0434\n\t\/\/ \u0417\u0434\u0435\u0441\u044c \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\n\t\/\/ \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u043a\u043e\u0434\u0430, \u0442\u043e \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 {}\n\t\/\/ \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c\n\techo \"$a == $b\";\n} else if ($a &lt;= $b) { \/\/ \u0415\u0441\u043b\u0438 $\u0430 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u044b\u043c $b\n\t\/\/ \u0415\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e,\n\t\/\/ \u0430 \u0437\u0434\u0435\u0441\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c,\n\t\/\/ \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u044d\u0442\u043e\u0442 \u043a\u043e\u0434\n\techo \"$a &lt;= $b\";\n} else {\n\t\/\/ \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b\n\techo \"$a &gt; $b\";\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043b\u0438\u0448\u044c \u0441 \u043e\u0434\u043d\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c&nbsp;<code>if<\/code>, \u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043d\u0435\u0451 \u0441\u043a\u043e\u043b\u044c\u043a\u043e-\u0443\u0433\u043e\u0434\u043d\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439&nbsp;<code>else if<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 if else, \u0447\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0435, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u00ab\u0438\u00bb \u0438\u043b\u0438 \u0436\u0435 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u00ab\u0438\u043b\u0438\u00bb:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if ($a != $b &amp;&amp; $a &gt; $b) {\n\t\/\/ \u041a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d, \u0435\u0441\u043b\u0438 \u0438 \u043f\u0435\u0440\u0432\u043e\u0435, \u0438 \u0432\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435\n\t\/\/ \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c\u0438\n}\n\nif ($a &lt; $b || $a == $b) {\n\t\/\/ \u041a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d, \u0435\u0441\u043b\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0432\u043e\u0435, \u0438\u043b\u0438 \u0432\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435\n\t\/\/ \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0422\u0435\u0440\u043d\u0430\u0440\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430&nbsp;<code>if else<\/code>. \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$x = 90;\n$a = 8;\n$res = $x &lt; $a ? ($x + $a) : ($x - $a);\necho $res;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0435\u0441\u043b\u0438 &#8220;x&#8221; \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u0437\u0430 &#8220;a&#8221;, \u0442\u043e \u043c\u044b \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e&nbsp;<code>res<\/code>&nbsp;\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u0445 \u0441\u0443\u043c\u043c\u0443, \u0438\u043d\u0430\u0447\u0435 &#8211; \u0438\u0445 \u0440\u0430\u0437\u043d\u0438\u0446\u0443.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043a\u043e\u0434. \u0412 \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[99],"tags":[],"class_list":["post-2568","page","type-page","status-publish","hentry","category-php-dlya-nachinayushhih"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages\/2568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/comments?post=2568"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages\/2568\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/media?parent=2568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/categories?post=2568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/tags?post=2568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}