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?

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.