php I need to write a json_encode function equivalent
<p>I'm trying to use webspace provided by my university.  They are currently using an outdated version of php, 5.1 I think.  Anyway it doesn't have a json_encode function, however, I need a json_encode function (or equivalent) for my code to work.  </p>

<p>So if anyone could explain to me the syntax for the return of the json_encode function or point me to a website that explains it nicely it'd be much appreciated.</p>

<p>Thanks</p>
