Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  108] [ 5]  / answers: 1 / hits: 158363  / 15 Years ago, wed, january 6, 2010, 12:00:00

I want to manipulate a JavaScript array in PHP. Is it possible to do something like this?



$.ajax({
type: POST,
url: tourFinderFunctions.php,
data: activitiesArray=+activities,
success: function() {
$(#lengthQuestion).fadeOut('slow');
}
});


Activities is a single dimensional array like:



var activities = ['Location Zero', 'Location One', 'Location Two'];


The script does not complete when I try this... How can I fix it?


More From » php

 Answers
7
data: { activitiesArray: activities },


That's it! Now you can access it in PHP:



<?php $myArray = $_REQUEST['activitiesArray']; ?>

[#97909] Sunday, January 3, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
meadowe

Total Points: 0
Total Questions: 97
Total Answers: 97

Location: Laos
Member since Fri, Sep 11, 2020
4 Years ago
;