How to convert array into JSON object in php : <p>I want to convert my array value:</p>

<pre><code>Array ( [page_1] =&gt; fifth [page_2] =&gt; first [page_3] =&gt; fourth [page_4] =&gt; third ) 
</code></pre>

<p>Into JSON format is given below</p>

<pre><code>{s:6:"page_1";s:5:"third";s:6:"page_2";s:5:"first";s:6:"page_3";s:6:"fourth";s:6:"page_4";s:5:"fifth";}
</code></pre>

<p>Can anyone please help me</p>
