2

製品を Google Base にエクスポートするためのスクリプトを書いています...問題は、次のコードを使用するin stockと出力され"in stock"、Google がそれを認識せず、引用符なしでのみ認識することです。そこに引用符を含めずにこれを行う方法がわかりません。

                        $row = array(
                            'new',
                            $product->getSku().'-'.$vehicle->getId(),
                            'https://www.domain.com/vehicles/'.str_replace(' ', '-', $make->getName()).'/'.str_replace(' ', '-', $model->getName()).'/'.$year.'/'.$product->getId(),
                            $this->tru->config->get('root.cdn.url').'-products/'.$product->getPicture(),
                            $product->getSellPrice(),
                            $title,
                            $year,
                            'in stock',
                            $product->getFCCID(),
                            'Visa,Mastercard,Discover,AmericanExpress',
                            'US::Ground:4.95,CA::Ground:28.95',
                            'small',
                            'Vehicles & Parts > Automotive Locking Systems > Remote Keyless Systems'
                        );

                        fputcsv($output, $row, $seperatorValue);
4

1 に答える 1

1

fputcsv() を使うより、自分で関数を書いた方がいいと思います

次のコード行の何か

$output = fopen("path/to/your/file.csv", "a+");

$line = join(',', $row);

fwrite($output, $line);

fclose($output);

お役に立てれば

于 2011-01-30T23:58:58.580 に答える