我正在使用 codeigniter 开发一个电子商务网站。当我使用 fopen、fclose 等文件操作函数时,它在模型类中显示语法错误。有人知道如何解决吗?我在 autoload.php 中添加了“文件”助手。我检查了 NetBeans 和 Dreamweaver 中的语法错误。在这里,我添加了一个示例类,其中包含我面临的问题,
<?php
Class amazon extends CI_Model
{
var $feed = <<<EOD
<?xml version="1.0" encoding="iso-8859-1"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>M_EXAMPLE_123456</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>INTRUG8888888</SKU>
<StandardProductID>
<Type>ASIN</Type>
<Value>B0EXAMPLEG</Value>
</StandardProductID>
<ProductTaxCode>A_GEN_NOTAX</ProductTaxCode>
<ItemPackageQuantity>1</ItemPackageQuantity>
<NumberOfItems>100</NumberOfItems>
<DescriptionData>
<Title>Balaji53444</Title>
<Brand>TESTERCLOTHING</Brand>
<Description><![CDATA[INTRUGTEST123 Test description of test product.]]></Description>
<BulletPoint>Test 3 Meterial</BulletPoint>
<MSRP currency="USD">0.10</MSRP>
<Manufacturer></Manufacturer>
<ItemType>example-item-type</ItemType>
</DescriptionData>
<ProductData>
<Clothing>
<VariationData>
<Parentage>child</Parentage>
<Size>Small</Size>
<Color>White</Color>
<VariationTheme>SizeColor</VariationTheme>
</VariationData>
<ClassificationData>
<ClothingType>Shirt</ClothingType>
<Department>Mens</Department>
<StyleKeywords>Apparel</StyleKeywords>
<ColorMap>White</ColorMap>
<InnerMaterial>White</InnerMaterial>
<OuterMaterial>White</OuterMaterial>
<Season>All Seasons</Season>
<CollarType>Crew</CollarType>
<SleeveType>Short</SleeveType>
<IsAdultProduct>false</IsAdultProduct>
</ClassificationData>
</Clothing>
</ProductData>
</Product>
</Message>
</AmazonEnvelope>
EOD;
var $marketplaceIdArray = array("Id" => array('A333NV4543ZUPX1J3X'));
var $feedHandle = fopen('php://temp', 'rw+');
}
?>