Im using jquery ajax to send some data to a php file
$.ajax({
type: 'GET',
url: 'dosomething.php',
data: {list:orderNew}
});
Which is sending this to the php
$list = $_GET['list'];
print $list gives me this:
list[4]=null&list[1]=null&list[2]=4&list[12]=null&list[11]=null&list[3]=null
I was hoping to get it as an array so i could do this on my php file
foreach($list as $key => $value) {
if($value == "null"){
$value = 0;
}
}
How can a send the list[] data as an actually array so php reads it as an array or turn the string into an array so i can do my foreach on my php page?
Try
Outputs