title: Proper way to save a javascript canvas path into a database
body: <p>What is a proper way to save a javascript canvas path to a mysql database using php.</p>
  
  <p>The path can look something like this: </p>
  
  <pre><code>array:3 [
    0 =&gt; array:3 [
      0 =&gt; "M"
      1 =&gt; 127.83333333333
      2 =&gt; 70.486111111111
    ]
    1 =&gt; array:5 [
      0 =&gt; "Q"
      1 =&gt; 127.83333333333
      2 =&gt; 70.486111111111
      3 =&gt; 128.33333333333
      4 =&gt; 70.486111111111
    ]
    2 =&gt; array:5 [
      0 =&gt; "Q"
      1 =&gt; 128.83333333333
      2 =&gt; 70.486111111111
      3 =&gt; 129.41666666667
      4 =&gt; 70.486111111111
    ]
    3 =&gt; array:5 [
      0 =&gt; "Q"
      1 =&gt; 130
      2 =&gt; 70.486111111111
      3 =&gt; 130.83333333333
      4 =&gt; 70.486111111111
    ]
  ]
  </code></pre>
  
  <p>But is in most cases larger.
  Further there can be multiple paths(arrays) linked to a entity let's say <code>user_id</code>. What is a good way to manage this in my database. One could serialize the data or use <code>json_encode</code>, but I am not sure if that is really the way to go.</p>