title: How to pass multidimensional values to a json array?
body: <p>I am trying to pass the value to an api through json request.</p>
  
  <pre><code>  $payload = json_encode( array("phones"=&gt; "971xxxxxxx",
  "emails"=&gt; "fadfad@xyz.com",
  "id"=&gt; "1"
    ) );
  </code></pre>
  
  <p>How will i pass the below multi dimensional values to a json request like the above code?</p>
  
  <pre><code> { "contactList": [ { "phones" : ["+91 9000000034"], "emails" : [fadfad@xyz.com], "id" : 1 }, { "phones" : ["+91 903-310-00-001"], "emails" : [krs@xyz.in], "id" : 2 } ] }
  </code></pre>