我有一个由此查询创建的数组:
$run=0;
$result = $conn->query("SELECT distinct isbn13 from inventory
WHERE quantity>0 and isbn13 like '978%' limit $run, 20");
while($image = $result->fetch_assoc())
{
$isbn[$x] = $image['isbn13'];
$x++;
} //end while
我需要将它传递给这个函数:
$parsed_xml = ProductId_xml($isbn);
我知道 $isbn 中有信息,因为我使用了 print_r($isbn); 并看到了阵列。但是,当我在函数 (var_dump($searchterm); die;) 中执行相同操作时,我得到 NULL。这是函数的一部分:
count=0;
function ProductId_xml($searchTerm) {
var_dump($searchTerm); die;
$params = array(
'AWSAccessKeyId' => AWS_ACCESS_KEY_ID,
'Action' => "GetMatchingProductForId",
'SellerId' => MERCHANT_ID,
'SignatureMethod' => "HmacSHA256",
'SignatureVersion' => "2",
'Timestamp'=> gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time()),
'Version'=> "2011-10-01",
'MarketplaceId' => MARKETPLACE_ID,
'IdType' => "ISBN",
);
$id=array(explode(',',$searchTerm));
foreach ($id as $newId)
{
$count .= $count +1;
$params += array('IdList.Id.'.$count => $newId);
} //end of foreach
如何将信息放入我的函数中?