Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Rewritten: jQuery / How do I use an array Re: Rewritten: jQuery / How do I use an array

#59409
Quote:
$.post(‘/link/to/file/’, {data : checkData.join(‘, ‘)} );

That is not the best way to send data to a php script.

The most efficient way is to use a subscripted variable, this way the data will be accessible as an array in the php script.

For example:

Code:
$.post(‘/link/to/file/’, { ‘data[]’ : checkData });

Now in php the posted data will be available as an array:

$_POST[0]
$_POST[1]
etc…