{"id":687,"date":"2013-02-05T05:38:01","date_gmt":"2013-02-05T05:38:01","guid":{"rendered":"http:\/\/codeatelier.wordpress.com\/?p=455"},"modified":"2013-02-05T05:38:01","modified_gmt":"2013-02-05T05:38:01","slug":"455","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/455\/","title":{"rendered":""},"content":{"rendered":"<p>I have a Two PHP arrays as Below<\/p>\n<p>Array 1 &#8211; Budget Start<br \/>\n$start = Array(25000,30000,35000,15900);<\/p>\n<p>Array 2 &#8211; Budget End<br \/>\n$end = Array(40000,50000,60000,55000);<\/p>\n<p>I want to Filter the Budget range which the user is actually looking for.For the above the budget range is 35000 For Budget Start and 40000 for Budget End.<\/p>\n<p>Budget Start 35000 because<br \/>\n25000 &lt;= 35000 &lt; 40000<br \/>\n30000 &lt;= 35000 &lt; 50000<br \/>\n35000 &lt;= 35000 &lt; 60000<br \/>\n15900 &lt;= 35000 &lt; 55000<\/p>\n<p>Budget End 40000 because<br \/>\n25000 &lt; 40000 &lt;= 40000<br \/>\n30000 &lt; 40000 &lt;= 50000<br \/>\n35000 &lt; 40000 &lt;= 60000<br \/>\n15900 &lt; 40000 &lt;= 55000<\/p>\n<pre>$start = Array(25000,30000,35000,15900);\n\n$end = Array(40000,50000,60000,55000);\n\nforeach($start as $val){\n    $cnt = 0;\n    for($i=0;$i&lt;count($start); $i++){\n        if($start[$i] &lt;= $val &amp;&amp; $val &lt; $end[$i]){\n            $cnt++;\n        }\n        if($cnt == count($start)){\n            $start_budget = $val;\n        }\n    }\n}\n\nforeach($end as $val){\n    $cnt = 0;\n    for($i=0;$i&lt;count($end); $i++){\n        if($start[$i] &lt; $val &amp;&amp; $val &lt;= $end[$i]){\n            $cnt++;\n        }\n        if($cnt == count($end)){\n            $end_budget = $val;\n        }\n    }\n}\n\necho $start_budget;\necho \"\n\";\necho $end_budget;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I have a Two PHP arrays as Below Array 1 &#8211; Budget Start $start = Array(25000,30000,35000,15900); Array 2 &#8211; Budget End $end = Array(40000,50000,60000,55000); I want to Filter the Budget range which the user is actually looking for.For the above the budget range is 35000 For Budget Start and 40000 for Budget End. Budget Start&hellip; <a href=\"https:\/\/codethataint.com\/blog\/455\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[93],"tags":[],"class_list":["post-687","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=687"}],"version-history":[{"count":0,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/687\/revisions"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}