title: Swift make a http request response as array
body: <p>I have got this swift http request</p>
  
  <pre><code>    var request = URLRequest(url: URL(string: "http://www.web.com/ajax/logreg.php")!)
      request.httpMethod = "POST"
      let pass = pass_text_field.text!.addingPercentEncoding(withAllowedCharacters: .queryValueAllowed)!
      let postString = "app_reg_pass=\(pass)"
      request.httpBody = postString.data(using: .utf8)
      let task = URLSession.shared.dataTask(with: request) { data, response, error in
          guard let data = data, error == nil else {
              print("error=\(error!)")
              return
          }
          if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 {                           print("statusCode should be 200, but is \(httpStatus.statusCode)")
              print(response!)
          }
  
          let responseString = String(data: data, encoding: .utf8)
          print(responseString!)
      }
      task.resume()
  </code></pre>
  
  <p>Reponse string:</p>
  
  <pre><code>Array
  (
      [0] =&gt; 1
      [1] =&gt; Murad
  )
  </code></pre>
  
  <p>And my response to this code is array.But when i try to treat response as array it gives me an error.How can i turn response into array so i can do this 
  <code>response[0]</code>?</p>