PHP foreach using an array sent via an ajax request failing. Correct data sent to function
<p>In an ajax request, i'm sending an array of member_id's in order to get back the screen names. The member id's are stored as follows:</p>

<pre><code>var member_id = [];
    Ext.each(selected_rows, function(item) {
        member_id.push(item.data.member_id);
    });
</code></pre>

<p>I'm then sending them to a retrieve_members function</p>

<pre><code>Ext.Ajax.request({
                    action: 'retrieve_members',
                    member_id: member_id,
                    success_fn: function(response) {
                    //do stuff
                    }
                }); //end ajaxRequest
</code></pre>

<p>Firebug shows this when call is sent:</p>

<pre><code>action  retrieve_members
member_id   45FA3B10-4546-B9F7-D23
member_id   9627B65B-4D82-B2E8-4CE
</code></pre>

<p>In the retrieve_members function:</p>

<pre><code>function retrieve_members($request) {
$member_ids = substr($request-&gt;member_id,0,-1);

    foreach($member_ids as $member_id) {

        $current_member = Member::retrieveById($request-&gt;db, $member_id);
        $member_list = $current_member-&gt;getGroupMembers();
        $members = array();
        foreach ( $member_list as $member ) {

            $member_list[] = array(
                'id' =&gt; $member-&gt;id,
                'screen_name' =&gt; $member-&gt;screen_name,
            );
        }
    }
return json_encode(array('status' =&gt; 'OK', 'member_list' =&gt; $member_list));
}
</code></pre>

<p>If I remove the foreach and replace the following line:</p>

<pre><code>$member = Member::retrieveById($request-&gt;db, $request-&gt;$member_id);
</code></pre>

<p>I get the correct data back for 1 member. I know the "substr($request->member_id,0,-1);" may be wrong, but I've made many attempts to pass the correct member_ids to the foreach. I'm not sure what i'm doing wrong, but as this stands it will member_list will always come back null. Any help is appreciated, thanks!</p>

<p>UPDATE:
print_r($request->member_id); returns the following error:</p>

<pre><code>identifier starts immediately after numeric literal
[Break On This Error]   

(9627B65B-4D82-B2E8-4CE)
</code></pre>
