How to get different variables from PHP page ? (example included)...

How do I create a page like this in PHP and request specific variables from that page in Unity ?

Right now I just use one text file with one variable in it and WWW request that string from the text file, convert it to an int and then use it as a variable.

alt text

HTTP is the Hyper Text Transfer Protocol. So by default it’s ment to transmit text. However in theory you could return plain binary and encode your values any way you like. However for web services it’s common to just serialize them as JSON or another text based serialization. If you really want to return your data in binary you can use the “pack” function in PHP and on the Unityside you would use a BinaryReader on the “bytes” array.

The page you showed seems to be more related to serverside storage inside a database and not that much about the format of a response.