I tried here and here - without success
function abc() {
var sky = 'blue';
var earth = 'deep';
var sun = 'gold';
$.ajax({
url: 'images.php',
type: 'post',
data: {'earth': earth, 'sun': sun, 'sky': sky},
success: function(data) {
// here I want new values as js array from php array
}
});
}
images.php
... some code...
$sky = "over";
$earth = "down";
$sun = "middle";
echo array($sky, $earth, $sun);
The above is very simplified example. In reality my variables inside php array are much more complex. So I don't want use the concatenation method on php side and split
a string on js
side.