我正在使用亚马逊API PHP库从我们的卖家中心帐户下载报告。PHP亚马逊API多功能变量
有一个名为“UpdateReportAcknowledgements”的API调用,它使用库中的MarketplaceWebService_Model_UpdateReportAcknowledgementsRequest
。该类有一个setReportIdList
方法,它以MarketplaceWebService_Model_IdList
作为参数。 MarketplaceWebService_Model_IdList
类有一个名为withId
的方法,这是我需要帮助的地方。
的withId
方法库中的这些注释:
/**
* Sets single or multiple values of Id list via variable number of arguments.
* For example, to set the list with two elements, simply pass two values as arguments to this function
* <code>withId($id1, $id2)</code>
*/
因此可以接受多个ID变量(然后使用func_get_args()
函数内)。我确定接受一个数组会更容易(对我而言),但我并不想更新Amazons库代码。
我有一个array()
包含3个ID(存储为字符串)。
如何取我的数组,并将其变为withId
方法的3个参数变量..?
UPDATE 我的数组目前有3个ID,但可能会更改为1或6或15或任何其他数字。每次调用方法时,ID的数量都会改变。
我不知道我正确理解你的问题。你不能这样做:'withId($ array [0],$ array [1],$ array [2])'? –
对不起,这次我在我的阵列中有3个ID,但下次可能是1或8或15。 –