I'm writing a PHP app that integrates with Infusionsoft. I've googled my error and people seem to be getting it when they pass a string into a function instead of a int. But I don't seem to be doing that. This function takes an Array with string key value pairs.
My Code:
$contdata = Array();
foreach($regfields as $key => $value){
$contdata[str_replace(" ","",$value['name'])] = $answers[$key]);
}
print_r($contdata);
$conID = $app->addCon($contData);
The print returns:
Array ( [FirstName] => test [LastName] => test [State] => TX [PostalCode] => 77006 [Email] => lovefaithswing@gmail.com )
The error:
ERROR: -1 - No method matching arguments: java.lang.String, java.lang.String
My connection to Infusionsoft is fine since I am able to query for custom fields just previous to this. I thought it was my postal code, but I checked and PostalCode is suppose to be a string (and is).
I tried manually creating the array and that worked fine, so it has something to do with the fact t开发者_Python百科hat I'm looping to dynamically create the array.
I added (string) types to both the key and the value to make sure everything is a string. Still didn't work.
Any ideas?
Hailey
I ended up realizing that I had a typo. I had $contData when I needed $contdata.
精彩评论