amolv Posted April 19, 2011 Share Posted April 19, 2011 hi all, mine http call : <script type="text/javascript"> var leadidarray =new Array(); leadidarray[1] = 100; leadidarray[2] = 200; leadidarray[3] = 300; leadidarray[4] = 400; leadidarray[5] = 500; var url = 'test.php?query=test&leadarray='+leadidarray; $.getJSON(url,function(data){}); <script> Now on the processing page i am getting $row = $_GET[leadarray] ; var_dump($_GET[leadarray]); or print_r( $_GET[leadarray] ); gives me values 100,200,300,400,500 but i want all that separate variables or all values in array so i can compare with another array, how can i do that? Quote Link to comment https://forums.phpfreaks.com/topic/234128-retrive-elements-from-array-which-is-sent-to-another-page-by-postget/ Share on other sites More sharing options...
Muddy_Funster Posted April 19, 2011 Share Posted April 19, 2011 use for each or explode. you will be able to look them up at the PHP manual site in your chosen language. Quote Link to comment https://forums.phpfreaks.com/topic/234128-retrive-elements-from-array-which-is-sent-to-another-page-by-postget/#findComment-1203365 Share on other sites More sharing options...
amolv Posted April 19, 2011 Author Share Posted April 19, 2011 thank you very much Muddy !, Actually i figured out there we put $var = $_GET['arrayname']; if we echo it $var it gives val1,val2, val3 and so on then to remove ',' and again to compare with another array i used explode which gives me array, hence solved! Thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/234128-retrive-elements-from-array-which-is-sent-to-another-page-by-postget/#findComment-1203374 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.