{"id":553,"date":"2020-05-21T11:58:31","date_gmt":"2020-05-21T08:58:31","guid":{"rendered":"https:\/\/ek.oa.edu.ua\/Kukhta\/test3\/?p=553"},"modified":"2020-05-21T12:00:39","modified_gmt":"2020-05-21T09:00:39","slug":"vykorystannia-riadkovykh-funktsij-v-php","status":"publish","type":"post","link":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/vykorystannia-riadkovykh-funktsij-v-php\/","title":{"rendered":"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u043d\u044f \u0440\u044f\u0434\u043a\u043e\u0432\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0456\u0439 \u0432 PHP"},"content":{"rendered":"<p>\u0423 \u0446\u044c\u043e\u043c\u0443 \u0443\u0440\u043e\u0446\u0456 \u043c\u0438 \u043f\u043e\u0434\u0438\u0432\u0438\u043c\u043e\u0441\u044f \u044f\u043a \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0434\u0435\u043a\u0456\u043b\u044c\u043a\u0430 \u0440\u044f\u0434\u043a\u043e\u0432\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0456\u0439 \u0434\u043b\u044f \u043e\u0431\u0440\u043e\u0431\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0443.<\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0456\u044f <code>substr<\/code><\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0456\u044f <code>substr<\/code> \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u0447\u0430\u0441\u0442\u0438\u043d\u0438 \u0440\u044f\u0434\u043a\u0430. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:<\/p>\n<pre class=\"prettyprint linenums\">string substr (string <span class=\"hljs-variable\">$string<\/span>, int <span class=\"hljs-variable\">$start<\/span> [, int <span class=\"hljs-variable\">$length<\/span> ])<\/pre>\n<p>\u041f\u0435\u0440\u0448\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>$string<\/code> &#8211; \u0440\u044f\u0434\u043e\u043a, \u0437 \u044f\u043a\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0430 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043f\u0456\u0434\u0440\u044f\u0434\u043e\u043a \u043f\u043e\u0447\u0438\u043d\u0430\u044e\u0447\u0438 \u0437 \u043f\u043e\u0437\u0438\u0446\u0456\u0457 <code>$start<\/code> \u0456 \u0437\u0430\u0432\u0434\u043e\u0432\u0436\u043a\u0438 \u0432 <code>$length<\/code>.<br \/>\n\u041f\u0440\u0438\u043a\u043b\u0430\u0434:<\/p>\n<pre class=\"prettyprint linenums\"><span class=\"hljs-preprocessor\">&lt;?php\r\n<\/span><span class=\"hljs-keyword\">echo<\/span> substr(<span class=\"hljs-string\">\"Hello world\"<\/span>, <span class=\"hljs-number\">6<\/span>, <span class=\"hljs-number\">5<\/span>);\r\n<span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456:<\/p>\n<pre class=\"result\"><span class=\"hljs-string\">world<\/span><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043d\u043d\u0456\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>$length<\/code> \u043d\u0435\u043e\u0431\u043e\u0432&#8217;\u044f\u0437\u043a\u043e\u0432\u0438\u0439<\/p>\n<pre class=\"prettyprint linenums\"><span class=\"hljs-preprocessor\">&lt;?php\r\n<\/span><span class=\"hljs-keyword\">echo<\/span> substr(<span class=\"hljs-string\">\"Hello world !!!\"<\/span>, <span class=\"hljs-number\">6<\/span>);\r\n<span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0456:<\/p>\n<pre class=\"result\">world !!!<\/pre>\n<p>\u042f\u043a\u0449\u043e <code>$start<\/code> \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u0438\u0439 (\u0437\u0456 \u0437\u043d\u0430\u043a\u043e\u043c -), \u0442\u043e \u043f\u043e\u0432\u0435\u0440\u0442\u0430\u043d\u0438\u0439 \u043f\u0456\u0434\u0440\u044f\u0434\u043e\u043a \u043c\u0430\u0442\u0438\u043c\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f \u0432\u0456\u0434 \u043a\u0456\u043d\u0446\u044f \u0440\u044f\u0434\u043a\u0430 \u0434\u043e \u043f\u043e\u0437\u0438\u0446\u0456\u0457 <code>$start<\/code> \u0437 \u043a\u0456\u043d\u0446\u044f \u0440\u044f\u0434\u043a\u0430.<\/p>\n<p><strong><span style=\"color: #993300;\">\u0414\u043b\u044f \u0431\u0430\u0433\u0430\u0442\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u0438\u0445 \u043a\u043e\u0434\u0443\u0432\u0430\u043d\u044c (\u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0434\u043b\u044f \u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0456) \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0456\u044e <code>mb_substr<\/code> \u0437 \u0442\u0438\u043c \u0436\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c, \u0449\u043e \u0456 \u0432 <code>substr<\/code><\/span><\/strong><\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0456\u044f <code>strpos<\/code><\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0456\u044f \u043f\u043e\u0432\u0435\u0440\u0442\u0430\u0454 \u043f\u043e\u0437\u0438\u0446\u0456\u044e \u043f\u0435\u0440\u0448\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0436\u0435\u043d\u043d\u044f \u043f\u0456\u0434\u0440\u044f\u0434\u043a\u0430 \u0432 \u0440\u044f\u0434\u043e\u043a<\/p>\n<pre class=\"prettyprint linenums\">int strpos (string <span class=\"hljs-variable\">$string<\/span> , mixed <span class=\"hljs-variable\">$needle<\/span> [, int <span class=\"hljs-variable\">$offset<\/span> = <span class=\"hljs-number\">0<\/span> ])<\/pre>\n<p>\u041f\u0435\u0440\u0448\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>$string<\/code> &#8211; \u0440\u044f\u0434\u043e\u043a \u0432 \u044f\u043a\u043e\u043c\u0443 \u0431\u0443\u0434\u0435 \u0437\u0440\u043e\u0431\u043b\u0435\u043d\u0438\u0439 \u043f\u043e\u0448\u0443\u043a, <code>$needle<\/code> &#8211; \u0440\u044f\u0434\u043e\u043a, \u044f\u043a\u0438\u0439 \u0442\u0440\u0435\u0431\u0430 \u0437\u043d\u0430\u0439\u0442\u0438, <code>$offset<\/code> &#8211; \u043d\u0435\u043e\u0431\u043e\u0432&#8217;\u044f\u0437\u043a\u043e\u0432\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u044f\u043a\u0449\u043e \u0446\u0435\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432\u043a\u0430\u0437\u0430\u043d\u0438\u0439, \u0442\u043e \u043f\u043e\u0448\u0443\u043a \u0431\u0443\u0434\u0435 \u0440\u043e\u0437\u043f\u043e\u0447\u0430\u0442\u0438\u0439 \u0437 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u0457 \u043a\u0456\u043b\u044c\u043a\u043e\u0441\u0442\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0456\u0432 \u0437 \u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0440\u044f\u0434\u043a\u0430<br \/>\n\u041f\u0440\u0438\u043a\u043b\u0430\u0434:<\/p>\n<pre class=\"prettyprint linenums\"><span class=\"hljs-preprocessor\">&lt;?php\r\n<\/span><span class=\"hljs-keyword\">echo<\/span> strpos(<span class=\"hljs-string\">\"Hello world\"<\/span>, <span class=\"hljs-string\">\"world\"<\/span>); <span class=\"hljs-comment\">\/\/ \u043e\u0442\u0440\u0438\u043c\u0430\u0454\u043c 6\r\n<\/span><span class=\"hljs-preprocessor\">?&gt;<\/span><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0456, \u043e\u0442\u0440\u0438\u043c\u0430\u0454\u043c\u043e 6, \u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0440\u044f\u0434\u043e\u043a &#8220;world&#8221; \u0443\u043f\u0435\u0440\u0448\u0435 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0430\u0454\u0442\u044c\u0441\u044f \u043d\u0430 6 \u043f\u043e\u0437\u0438\u0446\u0456\u0457<\/p>\n<p><strong><span style=\"color: #993300;\">\u0414\u043b\u044f \u0431\u0430\u0433\u0430\u0442\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u0438\u0445 \u043a\u043e\u0434\u0443\u0432\u0430\u043d\u044c (\u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434, \u0434\u043b\u044f \u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0456) \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0456\u044e <code>mb_strpos<\/code> \u0437 \u0442\u0438\u043c \u0436\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c, \u0449\u043e \u0456 \u0432 <code>strpos<\/code><\/span><\/strong><\/p>\n<p><span style=\"color: #3366ff;\"><strong><a style=\"color: #3366ff;\" href=\"http:\/\/php720.com\/lesson\/25\">\u0421\u043f\u0438\u0441\u043e\u043a \u0444\u0443\u043d\u043a\u0446\u0456\u0439 \u0434\u043b\u044f \u043e\u0431\u0440\u043e\u0431\u043a\u0438 \u0440\u044f\u0434\u043a\u0456\u0432<\/a><\/strong><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423 \u0446\u044c\u043e\u043c\u0443 \u0443\u0440\u043e\u0446\u0456 \u043c\u0438 \u043f\u043e\u0434\u0438\u0432\u0438\u043c\u043e\u0441\u044f \u044f\u043a \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0434\u0435\u043a\u0456\u043b\u044c\u043a\u0430 \u0440\u044f\u0434\u043a\u043e\u0432\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0456\u0439 \u0434\u043b\u044f \u043e\u0431\u0440\u043e\u0431\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0443. \u0424\u0443\u043d\u043a\u0446\u0456\u044f substr \u0424\u0443\u043d\u043a\u0446\u0456\u044f substr \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0454\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u043d\u044f \u0447\u0430\u0441\u0442\u0438\u043d\u0438 \u0440\u044f\u0434\u043a\u0430. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441: string substr (string $string, int $start [, int $length ]) \u041f\u0435\u0440\u0448\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 $string &#8211; \u0440\u044f\u0434\u043e\u043a, \u0437 \u044f\u043a\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u0430 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043f\u0456\u0434\u0440\u044f\u0434\u043e\u043a \u043f\u043e\u0447\u0438\u043d\u0430\u044e\u0447\u0438 \u0437 \u043f\u043e\u0437\u0438\u0446\u0456\u0457 $start \u0456 \u0437\u0430\u0432\u0434\u043e\u0432\u0436\u043a\u0438 \u0432 $length. \u041f\u0440\u0438\u043a\u043b\u0430\u0434: &lt;?php echo substr(&#8220;Hello [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-553","post","type-post","status-publish","format-standard","hentry","category-stroky"],"_links":{"self":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/comments?post=553"}],"version-history":[{"count":3,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/553\/revisions"}],"predecessor-version":[{"id":556,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/posts\/553\/revisions\/556"}],"wp:attachment":[{"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/media?parent=553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/categories?post=553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithub.oa.edu.ua\/webdev\/php\/wp-json\/wp\/v2\/tags?post=553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}