PHP code example of polarthink / submit

1. Go to this page and download the library: Download polarthink/submit 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/ */

    

polarthink / submit example snippets




use submit\Baidu;

$baidu = new Baidu([
    'target' => 'your domain',
    'token'  => 'your token',
]);

$baidu->submit('http://xxx...');



use submit\Baidu;

$baidu = new Baidu;

$baidu->target('your domain')->token('your token')->submit('your url');

use submit\Types;

$res = $object->submit($url);
switch ($res) {
    case Types::SUCCESS:
        echo '成功';
        break;
    case Types::ERROR_REQUEST:
        echo '请求错误';
        break;
    case Types::ERROR_RESPONSE;
        echo '返回错误';
        break;
    case Types::ERROR_SUBMIT:
        echo '提交错误';
        break;
}