Jump to content

retrive elements from array which is sent to another page by post/get !


amolv

Recommended Posts

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?

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.