PHP数组语法错误

时间:2016-04-06 13:01:16

标签: php arrays

我尝试运行此数组,但每次出现此错误

  

解析错误:语法错误,意外' =',期待')'第75行的C:\ wamp \ www \ soap-service \ AnchorSoapClient.php

这是我的PHP代码:

public function submitorder(){
            $this->init(); 
            $result = $this->soapClient->SubmitOrder(array('SO'=>array('Flag_Rush_Order'=>'','Date_Ship_By'=>0,'Shipping_Charge'=>0), 'SO_Detail'=>array('SalesOrderDetail'=>
                array('Product_Seq_Id'=>0,'Order_Quantity'=>0,'Ship_Quantity'=>0,'Unit_Price'=>0,'Discount'=>0,'Extension'=>0,'Customer_ID'=>''),'Flag_All_Complete'=>'','Ship_method_Seq_Id'=>0,'Store_Name'=>'','Store_Message'=>'','Store_Street'=>'','Store_City'=>'','Store_State'=>'','Store_Zip'=>'','Store_Country'=>'','Intl_Tax_Number'=>'','Intl_Tax_Description'=>'Intl_Tax_Description','Intl_Tax_Amount'=>0,'Special_Instruction'=>'','Date_Shipped'=>'Date_Shipped'));  
            return $result;
        }

这是第78行的代码:

$result = $this->soapClient->SubmitOrder(array('SO'=>array('Flag_Rush_Order'=>'','Date_Ship_By'=0,'Shipping_Charge'=>0), 'SO_Detail'=>

对PHP不太好。

1 个答案:

答案 0 :(得分:0)

检查'Date_Ship_By'=0,它应该是'Date_Ship_By'=>0, 你最后错过了“)”......

 $result = $this->soapClient->SubmitOrder(array('SO'=>array('Flag_Rush_Order'=>'','Date_Ship_By'=>0,'Shipping_Charge'=>0),
    'SO_Detail'=>array('SalesOrderDetail'=> array('Product_Seq_Id'=>0,'Order_Quantity'=>0,'Ship_Quantity'=>0,                    'Unit_Price'=>0,'Discount'=>0,'Extension'=>0,'Customer_ID'=>''),    'Flag_All_Complete'=>'','Ship_method_Seq_Id'=>0,'Store_Name'=>'','Store_Message'=>'',    'Store_Street'=>'','Store_City'=>'','Store_State'=>'','Store_Zip'=>'','Store_Country'=>'',    'Intl_Tax_Number'=>'','Intl_Tax_Description'=>'Intl_Tax_Description','Intl_Tax_Amount'=>0,'Special_Instruction'=>'','Date_Shipped'=>'Date_Shipped')));