title: jqGrid serializegriddata parsing in PHP
body: <p>I am extremely new to PHP and, although I am quite familiar to javascript, I am learning how to use the massive jqGrid plugin right now.  I am trying to understand how jqGrid serializes the grid data and how PHP parses this data.  Currently, I am not even connecting to MySQL, but I am simply trying to echo the serialized jqGrid data as "fake" results.  I have the following code for js in the head of my PHP file:</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
     $(function(){
        $('#list').jgGrid({
           url:'grid.php',
           mtype:'POST',
           colNames:['json'],
           colModel:[{name:'j',index:'j',searchoptions:{sopt:['eq']},search:true}],
           pager:'#pager',
           rowNum:10,
           viewrecords:true,
           gridview:true,
           serializeGridData:function(postData){
              return postData;
           }
        })
     });
  &lt;/script&gt;
  </code></pre>
  
  <p>I then send this information to my 'grid.php' file, which has the following code:</p>
  
  <pre><code>&lt;?php
     $jason = $_POST['postData'];
     $page = $jason-&gt;{'page'};
     echo '&lt;rows&gt;';
        echo '&lt;page&gt;1&lt;/page&gt;';
        echo '&lt;total&gt;1&lt;/total&gt;';
        echo '&lt;records&gt;1&lt;/records';
        echo '&lt;row id="1"&gt;';
           echo '&lt;cell&gt;'.$page.'&lt;/cell&gt;';
        echo '&lt;/row&gt;';
     echo '&lt;/rows&gt;';
  ?&gt;
  </code></pre>
  
  <p>When I remove the serializegriddata option from the JS, everything works fine (I also add in the default $_POST['page'], $_POST['rows'], $_POST['sidx'], $_POST['sord'] back into the PHP).  The problem comes in when I add the serializegriddata.  </p>
  
  <p>I am looking for any examples of how to use the postData on the client side (are the any other functions I need to add to the serializegriddata or can I just return the postData) and how to properly parse this in PHP (how to $_POST the data and then how to parse and use this data).  I know this is probably an extremely simple solution, but everything I find just talks about the client and says nothing about the server side.  Thanks in advance.</p>