$idArray = array(1,2,3,4);
can I write this line in HTML?
You could use serialize and & serialize along side with urlencode e.g.
On Sending you can send them like these:
"value1",["key2"]=>"value2");
$array2 = Array(["key1"]=>"value1",["key2"]=>"value2");
$data1="textdata";
$urlPortion= '&array1='.urlencode(serialize($array1)).
'&array2='.urlencode(serialize($array2)).
'&data1='.urlencode(serialize($data1));
//Full URL:
$fullUrl='http://localhost/?somevariable=somevalue'.$urlPortion
?>
On Receiving you can access them as:
And Voila, you can attach that url on ajax request or normal browser page.