+}</code></pre>\r
+<p>Below is a PHP example to do the same thing:</p><pre><code>$callback = $_REQUEST[<em>'callback'</em>];\r
+\r
+<i>// Create the output object.\r</i>
+$output = array(<em>'a'</em> => <em>'Apple'</em>, <em>'b'</em> => <em>'Banana'</em>);\r
+\r
+<i>//start output\r</i>
+<b>if</b> ($callback) {\r
+ header(<em>'Content-Type: text/javascript'</em>);\r
+ echo $callback . <em>'('</em> . json_encode($output) . <em>');'</em>;\r
+} <b>else</b> {\r
+ header(<em>'Content-Type: application/x-json'</em>);\r
+ echo json_encode($output);\r