Can this be converted to a PHP array?

Hello,

I’m working with a SDK for a web program I use and they have given me access to their APIs to access information outside the main application.

I’ve been writing some php code and I can push and pull some data. However, there’s a class of objecst that require an array as one of the fields in the function and they give me this example of code on how to do it. However, I have no idea how to convert this to a PHP array.

Can anyone help? Here’s what the manual states:

[i][b]For the purposes of this tutorial the syntax “name=value” would translate into:

NameValueBean[] nv = new NameValueBean[1];
nv[0] = new NameValueBean();
nv[0].setName(“name”);
nv[0].setValue(“value”);

“name1=value1, name1=value3, name2=value2” would translate into:

NameValueBean[] nv = new NameValueBean[3];
nv[0] = new NameValueBean();
nv[0].setName(“name1”);
nv[0].setValue(“value1”);
nv[1] = new NameValueBean();
nv[1].setName(“name1”);
nv[1].setValue(“value3”);
nv[2] = new NameValueBean();
nv[2].setName(“name2”);
nv[2].setValue(“value2”);[/b][/i]
If anyone has any idea on how to do this that would be awesome!

Thanks in advance!

Sponsor our Newsletter | Privacy Policy | Terms of Service