title: PHP add slashes in string
body: <p>I got this variable:</p>
  
  <pre><code>$payments['date'] = 21062013
  </code></pre>
  
  <p>The problem:</p>
  
  <p>Its a date, so I want to add slashes to this string.</p>
  
  <p>How I'm trying:</p>
  
  <pre><code>echo $paymentdate = substr($payments['date'],2)+/+substr($payments['date'],4)+/substr($payments['date'],8);
  </code></pre>
  
  <p>It's not working, can some one help?</p>
  
  <p>my full code:</p>
  
  <pre><code>$i = 0;
  foreach($SQL-&gt;query('SELECT id, form, email, value, data, date, compensated from payments where compensated="N"') as $payments)
  {
   $i++;
   $paymentdate = substr($payments['date'], 0, 2)."/".substr($payments['date'], 2, 2)."/".substr($payments['date'], 2, 8);
   echo '&lt;tr bgcolor="' . (is_int($i / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . '"&gt;  
    &lt;td&gt;' . $payments['id'] . '&lt;/td&gt;
    &lt;td&gt;' . $payments['form'] . '&lt;/td&gt;
    &lt;td&gt;' . $payments['email'] . '&lt;/td&gt;
    &lt;td&gt;' . $payments['value'] . '&lt;/td&gt;
    &lt;td&gt;' . $paymentdate .'&lt;/td&gt;
    &lt;td&gt;' . $payments['data'] . '&lt;/td&gt;
    &lt;td&gt;' . $payments['compensated'] . '&lt;/td&gt;
    &lt;td&gt;a&lt;/td&gt;
   &lt;/tr&gt;';
  }
  </code></pre>