{"id":1231,"date":"2017-11-16T15:28:06","date_gmt":"2017-11-16T13:28:06","guid":{"rendered":"https:\/\/burakcaliskan.org\/blog\/?p=1231"},"modified":"2017-11-16T15:28:06","modified_gmt":"2017-11-16T13:28:06","slug":"php-dizi-ardisik-kayitlaripespese-kayitlari-bulma","status":"publish","type":"post","link":"https:\/\/burakcaliskan.org\/blog\/php-dizi-ardisik-kayitlaripespese-kayitlari-bulma\/","title":{"rendered":"PHP dizi ard\u0131\u015f\u0131k kay\u0131tlar\u0131,pe\u015fpe\u015fe kay\u0131tlar\u0131 bulma"},"content":{"rendered":"<p>$needle = array(&#8216;a&#8217;, &#8216;b&#8217;);<br \/>\n$haystack = array(&#8216;x&#8217;, &#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;);<\/p>\n<p>function consecutive_values(array $needle, array $haystack) {<br \/>\n    $i_max = count($haystack)-count($needle);<br \/>\n    $j_max = count($needle);<br \/>\n    for($i=0; $i<$i_max; ++$i) {\n        $match = true;\n        for($j=0; $j<$j_max; ++$j) {\n            if($needle[$j]!=$haystack[$i+$j]) {\n                $match = false;\n                break;\n            }\n        }\n        if($match) {\n            return $i;\n        }\n    }\n    return -1;\n}\n\nVEYA\n\nfunction searchInArray($haystack, $needle)\n{\n    $keys = array_search($haystack, $needle[0]);\n\n    foreach ($keys as $key) {\n        $endPos = $key + count($needle);   \n        for ($i=1; $i<$count($needle); $i++) {\n            if ($needle[$i] == $haystack[$key + $i]) {\n                return $key;\n            }\n        }\n    }\n    return false;\n}\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>$needle = array(&#8216;a&#8217;, &#8216;b&#8217;); $haystack = array(&#8216;x&#8217;, &#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;); function consecutive_values(array $needle, array $haystack) { $i_max = count($haystack)-count($needle); $j_max = count($needle); for($i=0; $i<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22],"tags":[857,856,25],"_links":{"self":[{"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/posts\/1231"}],"collection":[{"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/comments?post=1231"}],"version-history":[{"count":1,"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/posts\/1231\/revisions"}],"predecessor-version":[{"id":1232,"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/posts\/1231\/revisions\/1232"}],"wp:attachment":[{"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/media?parent=1231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/categories?post=1231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/burakcaliskan.org\/blog\/wp-json\/wp\/v2\/tags?post=1231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}