Get a json object based on textarea content
<p>I'm trying to get the values of a text area and create a json object based on that .</p>

<p>The textarea looks like this:</p>

<pre><code>&lt;textarea name="msisdn" wrap="physical"&gt;
51971855080
51971855081
51971855082
&lt;/textarea&gt;
</code></pre>

<p>The dynamic parts are "messId" and "destAddr" the other ones will be replaced with php variables received from a form like this way:</p>

<pre><code>$str_obj_json='{
"method":"SUBMIT","params":{
"batchType":"submit",
"batchId":"'.$batch.'",
"origAddr":"550",
"origTon":2,
"userData":"'.$sms.'",
"submits":
  [
   {
   "messId":"mess127_009",
   "destAddr":"51971855080"},
   {
   "messId":"mess127_010",
   "destAddr":"51971855081"},
   {
   "messId":"mess127_011",
   "destAddr":"51971855082"},
  ]
}
}';
</code></pre>

<p>How to create this part dynamically ?:</p>

<pre><code>  "submits":
  [
   {
   "messId":"mess127_009",
   "destAddr":"51971855080"},
   {
   "messId":"mess127_010",
   "destAddr":"51971855081"},
   {
   "messId":"mess127_011",
   "destAddr":"51971855082"},
  ]
</code></pre>
