Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
Personally, I'm doing an application that sends a variable to a server via ajax. There is the possibility of sending a list of variables?
Yes, you can separate variables in this format:
a=value1&b=value2&c=value3...
would not have anything like a HashMap?
Develop games in your browser. Powerful, performant & highly capable.
one posibillity -
hashmap {foo: 1, bar:2}
1) convert it to one String/Text:
myHM= "foo:1|bar:2"
2) send it as one value
myScript.php?hashMap=myHM
3) extract the values back with php - splitting/parsing..
another possibility is converting your datas to a JSON-String and send this string,.. then php can simple extract the data (http://www.php.net/manual/en/function.json-decode.php)
I did so
list = {1:1, 2:2, 3:3, 4:4, 5:5}
<php
$ list = $ _GET ['list'];
$ test = var_dump (json_decode ($ list));
echo $ test [0]
?>
But it did not work. There appeared nothing
I need to stay that way in php
$test = array("test1" => array(1 => 1),"teste2" => array(2 => 1, 2 => 2),"teste3" => array(3 => 1, 3 => 3));
i try send a string, but not sucessful
Somebody?