javascript - jQuery $.ajax to pass multidimensional array to PHP -


i using jquery , php write json data server. i'm processing decent amount of repeating numeric data (~.75kb), want pass data php in form of multidimensional array.

at moment cannot manage data php in form can recognize. i've tried various combinations of sending/receiving arrays , objects no success.

the best case scenario 1 in pass array php , php converts readable form. i'd rather not use associative arrays or serializing on part of javascript.

code... giving me 500 internal server error, no longer occurs if omit passed data variable. (i'm not yet using $data in php file yet because know it's not working.)

 function generatedata() {   // code here   return [ one[ sub_one[], sub_two[] ], two[], three[], four[] /* etc... */ ] } function savedata() {     $.ajax({         url: "scripts/save.php",         data: {             "area":"testing",             "location":"testing",             "name":"testing",             "data":generatedata()         }     }); } 
<?php     $area = $_get['area'];     $location = $_get['location'];     $name = $_get['name'];     $data = $_get['data']);      # performing operations variables...      echo 1; ?> 

thanks can offer.

found solution:

"data": {     data: generatecelldata() } 

the above code passes data object php, whereby can access original array $data("data"). i'm still baffled why works when i'm passing data , other parameters object.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -