PHP code example of liliuwei / php-sitemap

1. Go to this page and download the library: Download liliuwei/php-sitemap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

liliuwei / php-sitemap example snippets


$site = new \liliuwei\Sitemap();
$cate = [
    1 => '男装',
    2 => '女装'
];

$article_list = [
    1 => '怎么穿衣服有气质  教你身材不好也可以穿出女神范',
    2 => '秋冬穿衣搭配图片  秋冬季内搭和大衣要如何搭配呢'
];
foreach ($cate as $key => $value) {
    $site->AddItem('http://www.youqunaya.com/list.html?cid=' . $key, 1);