how to pass an array in GET in PHP? -


$idarray = array(1,2,3,4); 

can write line in html?

<form method='post' action='{$_server['php_self']}?arr={$idarray}'> 

or should write:

<form method='post' action='{$_server['php_self']}?arr[]={$idarray}'> 

how passed?

how should handle in called page?

thanks !!

if want pass array parameter, have add parameter each element. query string become:

?arr[]=1&arr[]=2&arr[]=3&arr[]=4 

as others have written, can serialize , unserialize array.

but have send data client again? looks need way persist data between requests.

in case, better imo use sessions(docs). more secure otherwise client modify data.


Comments