title: I need to get an array from my app in an email with PHP
body: <p>I have a tableview and want to get that data send by email by click on a button with PHP. The tableview data comes from a <code>array</code>.  I manage to get a variable in my email as you see below in the code but not an array (like the data from my tableview)  Can someone help me?</p>
  
  <pre><code>func postToServerFunction() {
  
      let myUrl = NSURL(string: "http://www.aaa.com/be/file.php")
      let request = NSMutableURLRequest(url: myUrl! as URL)
       let userTotal = String(cartBrain.total)
      var bodyData = "data=\(userTotal)"
      request.httpMethod = "POST"
      request.httpBody = bodyData.data(using: String.Encoding.utf8)
      let task = URLSession.shared.dataTask(with: request as URLRequest)
  
  }
  </code></pre>
  
  <p>and my PHP code:</p>
  
  <pre><code>&lt;?php
  $postVar = $_POST['data'];
  if(!empty($postVar)){
      mail(“userEmail”,”email verzonden", $postVar);
  }
  ?&gt;
  </code></pre>