Home > Backend Development > PHP Tutorial > How to export data to Taobao Assistant CSV with PHP_PHP Tutorial

How to export data to Taobao Assistant CSV with PHP_PHP Tutorial

WBOY
Release: 2016-07-21 15:39:57
Original
999 people have browsed it

First picture
How to export data to Taobao Assistant CSV with PHP_PHP Tutorial
How to export data to Taobao Assistant CSV with PHP_PHP Tutorial
Principle of implementation

First read the data, write the corresponding segment of the CSV row with the corresponding data segment, and then save it as CSV. The test passed in the latest version of Taobao Assistant

Implementation code

Copy code The code is as follows:

function totaobao()
{

                                                                             ;
                                                                                                                                                                                         Method, product price, price increase, product quantity, validity period, freight burden, surface mail, EMS, express delivery, payment method, Alipay, invoice, warranty, automatic reissue, put in warehouse, window recommendation, start time, mood story, product description , baby pictures, baby attributes, group purchase price, minimum number of group purchase pieces, postage template ID, member discount, modification time, upload status, picture status, rebate ratio, new pictures, videos, sales attribute combinations, user input ID string, user input name -Value pair, merchant code, sales attribute alias, recharge type, baby number");

header("Content-type:text/csv");
header("Content-Disposition:attachment ;filename=ybkgoods.csv");
header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
header('Expires:0');
header('Pragma:public');
echo "$headern";

//Output data body
foreach($result as $value)
{
/ /Filter description field
             $desc = csvdatafilter("www.yibaikuan.com",$value['goods_desc']); goods_thumb'],24,25);
                                                                                                                                                                                                                                                                                 ,Zhejiang,Jinhua,b,".$value['shop_price'].",0,".$value['goods_number'].",14,1,20,20,10,,,0,0,1 ,0,1,,,".$desc.",,,,,0,0,,100,,0,".$img.":0:0:|;,,,,,,,0, ");
                        echo "$bodyn";                                                HTML code filtering issues in
3. Pay attention to the path of the image
Conclusion:
The principles of CSV generated for Taobao, Paipai, and Youah Assistant are almost the same. You can test it if necessary.




http://www.bkjia.com/PHPjc/321425.html

www.bkjia.com
true

http: //www.bkjia.com/PHPjc/321425.html

TechArticle

First, the picture is shown to implement the principle. First, read the data and write the corresponding segment of the CSV row with the corresponding data segment. , and then save it as CSV. The implementation code was tested in the latest version of Taobao Assistant...

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template