title: Create JSON object using PHP
body: <h2>How can I achieve or create this type JSON object using PHP?</h2>
  
  <pre><code>{ 
      "label": "Devices per year",
      "data": [
          [1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]
      ]
  }
  </code></pre>
  
  <hr>
  
  <p>After several attempt I didn't find the solution.
  For example I tried this:</p>
  
  <pre><code>$arrayDateAndMachine = array(
      "1999"=&gt;3.0, 
      "2000"=&gt;3.9
  );   
  
  $arr = array(
      "label" =&gt; "Devices per year", 
      "data" =&gt; $arrayDateAndMachine
  );
  
  var_dump(json_encode($arr));
  </code></pre>