Dealing with an array in an array?
<p><strong>UPDATE 1:</strong></p>

<p>I also have the following <code>foreach</code> loop in my code:</p>

<pre><code>foreach ($_POST as $key =&gt; $value){ 
    $message .= $key . " = " .$value ."\n\n&lt;br /&gt;"; 
}
</code></pre>

<p>Which is the final one.</p>

<p>Or maybe the problem is in the line:</p>

<pre><code>curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
</code></pre>

<p>Doesn't like the <code>%5B0%5D</code> in the string generated, i.e.</p>

<pre><code>transaction%5B0%5D=USD+21.00
</code></pre>

<p>using the code <code>$req = http_build_query($_POST);</code>?</p>

<p><strong>ORIGINAL QUESTION:</strong></p>

<p>I'm getting the following error message:</p>

<pre><code>[Sun Aug 04 10:00:00 2012] [error] [client 000.0.00.000] PHP Warning:  stripslashes() expects parameter 1 to be string, array given in /var/www/page.php on line 20
[Sun Aug 04 10:00:00 2012] [error] [client 000.0.00.000] PHP Stack trace:
[Sun Aug 04 10:00:00 20122] [error] [client 000.0.00.000] PHP   1. {main}() /var/www/page.php:0
[Sun Aug 04 10:00:00 2012] [error] [client 000.0.00.000] PHP   2. stripslashes() /var/www/page.php:20
</code></pre>

<p>The problem code is this:</p>

<pre><code>Line 19: foreach ($_POST as $key =&gt; $value) {
Line 20:     $value = urlencode(stripslashes($value));
Line 21:     $req .= "&amp;$key=$value";
Line 22: }
</code></pre>

<p>Where <code>$_POST</code> contains the following:</p>

<pre><code>Array
(
    [transaction] =&gt; Array
        (
            [0] =&gt; USD 21.00
        )

    [payment_request_date] =&gt; Sat Aug 04 10:00:00 PDT 2012
    [return_url] =&gt; http://000.000.000.000/success.php
    [fees_payer] =&gt; EACHRECEIVER
    [ipn_notification_url] =&gt; http://000.000.000.000/ipn.php
    [sender_email] =&gt; buyer_0394820394_per@gmail.com
    [verify_sign] =&gt; slkdfj30r2489urj0947830ru0ty80ur0er037jfgoiru932e.as329e
    [test_ipn] =&gt; 1
    [cancel_url] =&gt; http://000.000.000.000/cancel.php
    [pay_key] =&gt; AP-SLKJ30F9J90J3RSD3
    [action_type] =&gt; PAY
    [transaction_type] =&gt; Adaptive Payment PAY
    [tracking_id] =&gt; E4902RJF2
    [status] =&gt; COMPLETED
    [log_default_shipping_address_in_transaction] =&gt; false
    [charset] =&gt; windows-1252
    [notify_version] =&gt; UNVERSIONED
    [reverse_all_parallel_payments_on_error] =&gt; false
)
</code></pre>

<p>Is the <code>stripslashes()</code> giving me a problem because of the array within an array?  If yes, how can I deal with the <code>$_POST</code> in the <code>foreeach</code> loop, if no, what could the problem be?</p>
