A small program I am running will be creating 4 objects where each has data types like, bool array, strings, ints, etc, and all 4 classes are contained within a super class (for the purpose of making it one json string)
e.g.
public class Foo
{
private A a;
private B b;
private C c;
}
public class A
{
String str;
int int_;
}
public class B
{
boolean arr[];
}
public class C
{
// maybe an object, or rnum, or just priv data types
}
Now I can easily convert this into json use Gson library. my problem is sending this to a PHP page where it can decode the json and save the data from each object. Now I am new to PHP and from what I seen people say use
json_encode(); json_decode();
and which this I am wondering if this is the best/easiest way? from what I think i seen online, the decode will create an object but does that object match the java object to be exactly the same? is their a better way? Sorry for being a noob at this but any help is appreciated