I have an application (iOS) written in swift that makes an http post request to a PHP script. I want to pass an array from swift to the PHP API. Swift arrays are formatted as follows:
var array = [1, 2, 3, 4, 5]
and PHP arrays are obviously formatted like this:
$array = array(1, 2, 3, 4, 5);
However, when I try to call
$_POST['arrayFromSwift'];
I can't access indexes of individual items. How can I parse the array (either in swift or in the PHP API so that I can access individual items?
Thanks!
$_POST['arrayFromSwift']? Do avar_dump($_POST['arrayFromSwift']);.json_decode()in PHP.