{"id":102,"date":"2014-03-15T02:57:20","date_gmt":"2014-03-15T10:57:20","guid":{"rendered":"http:\/\/www.tech.dimprash.com\/?p=102"},"modified":"2014-06-04T05:44:58","modified_gmt":"2014-06-04T13:44:58","slug":"finding-if-a-string-occurs-in-another-string","status":"publish","type":"post","link":"http:\/\/www.tech.dimprash.com\/?p=102","title":{"rendered":"Finding if a string occurs in another string"},"content":{"rendered":"<p>Options:<br \/>\n1) strpos<br \/>\n2) strstr<\/p>\n<p>If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead of strstr. <\/p>\n<p>For case insensitive queries, use stripos and stristr<\/p>\n<p>strstr: Returns part of haystack string starting from and including the first occurrence of needle to the end of haystack. Has option in new version of PHP to return part of string before needle also. Returns false if not found. <\/p>\n<p>strpos: Find the numeric position of the first occurrence of needle in the haystack string.<br \/>\nReturns false if not found. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Options: 1) strpos 2) strstr If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead of strstr. For case insensitive queries, use stripos and stristr strstr: Returns part of haystack string starting from and including the first occurrence of needle to the &hellip; <a href=\"http:\/\/www.tech.dimprash.com\/?p=102\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Finding if a string occurs in another string<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=102"}],"version-history":[{"count":3,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":189,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions\/189"}],"wp:attachment":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}