PHP json_encode unknown error
<p>I am returning results from a MySql database in PHP that I would like to use the <strong>json_encode</strong> function to turn into a string to pass back for another page's usage to display options within a SELECT element. However, the json_encode method fails and my page is not rendering properly. By that I mean I receive a generic IIS error from the cgi-bin process. I have error capturing setup within my script but the error generated is not boiling up far enough to be shown and I am not sure why.</p>

<p>The basis of my question is how can I make <strong>json_encode</strong> like the information below or do I need to roll my own encoder to deal with it?</p>

<pre><code>Array
(
    [0] =&gt; stdClass Object
        (
            [productID] =&gt; 2
            [optionID] =&gt; 1
        )

    [1] =&gt; stdClass Object
        (
            [productID] =&gt; 2
            [optionID] =&gt; 2
        )

    [2] =&gt; stdClass Object
        (
            [productID] =&gt; 2
            [optionID] =&gt; 3
        )

    [3] =&gt; stdClass Object
        (
            [productID] =&gt; 2
            [optionID] =&gt; 4
        )

)
</code></pre>
