title: Use PHP Response to store/use data
body: <p>I declared a function to send information from some textfields (POST), then I get a response with the information given. I also used components(separatedBy: String) to get an array with the information from every field. What am trying to do now is to use this information (one from the array) to store/use it so I can show the user, in a new view, the information saved.</p>
  
  <p>My Swift looks like the following</p>
  
  <pre><code>      @IBAction func enviarInfo(_ sender: Any) {
        let request = NSMutableURLRequest(url: NSURL(string: "http://www.mydomain/index.php")! as URL)
        request.httpMethod = "POST"
  
  
        //The String with the vars that will be sent to the $_POST["var"]
        let postString = "nombre=\(nombreText.text!)&amp;aPaterno=\(apaternoText.text!)&amp;aMaterno=\(amaternoText.text!)&amp;genero=\(genero.text! &amp;email=\(emailText.text!)&amp;telefono=\(telefonoText.text!)"
  
  
        request.httpBody = postString.data(using: String.Encoding.utf8)
  
        let task = URLSession.shared.dataTask(with: request as URLRequest) {
        data, response, error in
  
              if error != nil {
              print("error=\(String(describing: error))")
              return
              }
  
        print("response = \(String(describing: response))")
  
           let responseString = NSString(data: data!, encoding: String.Encoding.utf8.rawValue)
  
           print("responseString = \(String(describing: responseString))")
  
        //Use a split method to get relevant information only
           let string: String = responseString! as String
           var str = string.components(separatedBy: "@@")
  
           let resultadoUno = str[1]
           var str2 = resultadoUno.components(separatedBy: "&gt;&gt;")
  
           let resultadoDos = str2[0]
           var str3 = resultadoDos.components(separatedBy: ";")
         }
    task.resume()     
  }
  </code></pre>
  
  <p>If I print, for example, str3[5] I get the phone number, or a name with str3[0], but what I don't know is, how to save the data and show it to the user via labels (label.text = the value from the array).</p>