how to fetch URL data
<p>i have created custom query which i am sending via POST ajax but problem with it is that how to retrieve that data</p>

<p>i am sending this query = <code>rep_id=4&amp;filter=&amp;filter_val=&amp;rep_id=5&amp;filter=&amp;filter_val=&amp;rep_id=6&amp;filter=&amp;filter_val=&amp;from=p_employee_mst</code></p>

<p>and here is the function to fetch that query in PHP</p>

<pre><code>$rep="";
foreach ($_POST["rep_id"] as $k =&gt; $v) {
    $rep[]=$v;
}
print_r($rep);
</code></pre>

<p>i am getting following error </p>

<p><strong>Invalid argument supplied for foreach()</strong></p>

<p>if print_r($_POST); i am getting this</p>

<pre><code>Array
(
    [rep_id] =&gt; 6
    [filter] =&gt; 
    [filter_val] =&gt; 
    [from] =&gt; p_employee_mst
)
</code></pre>
