...

View Full Version : Convert from Java to PHP



martialtiger
03-01-2007, 09:37 PM
Hi All,

I have scoured the net and still have not been able to find anything that would help me with this. I want to convert this


MapEntry[] myData = new MapEntry[2];
myData[0] = new MapEntry();
myData[0].setKey("first");
myData[0].setValue("My first name");
myData[1] = new MapEntry();
myData[1].setKey("last");
myData[1].setValue("My last name");

to php. I tried the following but the API I am does not appear to like it.


$subscriber_data = array();
$subscriber_data = array('firstName' => 'JM','lastName' => 'TEST');


Thanks in advance!

Nightfire
03-01-2007, 09:57 PM
$subscriber_data = array('firstName' => 'JM','lastName' => 'TEST');
print_r($subscriber_data);

That's all you need

martialtiger
03-01-2007, 10:58 PM
Thanks NF,

That's what I figured but the guys who created the API said it may be the problem.

aedrin
03-02-2007, 12:05 AM
Or more similar:



$myData = array();
$myData['first'] = 'My first name';
$myData['last'] = 'My last name';


You'll find that PHP is a lot shorter/more flexible.

GJay
03-02-2007, 01:12 PM
providing some details of the API might help...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum