简单
composer require qianlongzt/cet
<?php
require_once __DIR__ .'/vendor/autoload.php';
$ticket = '1234567891012345';
$name = '张三';
$source = '99sushe'; # chsi (学 信 网), 99sushe(99宿舍 )
$cetScore = Qianlongzt\Cet\CetScore::getScore($name, $ticket, $source);
var_dump($cetScore);
输出
array(15) {
["status"]=>
bool(true) # 是 否 获取成功
["errType"]=>
int(0) # 错误代 码
["errMsg"] =>
"ok" # 错误说明,为 0 时 不出 现这个 key
["name"]=>
string(6) "张三 "
["school"]=>
string(18) "xxx大学 "
["type"]=>
string(12) "英 语四级"
["ticket"]=>
string(15) "330000162100000" # 准 考 证号
["examTime"]=>
string(12) "2016年 12月"
["score"]=>
int(471) # 总分
["listening"]=> #听力
int(166)
["reading"]=> # 阅读
int(168)
["writing"]=> # 写 作 和 翻 译
int(137)
["hearingLoss"]=> # 听力残 疾 只 有 来 源 是 99sushe 才 有
bool(false)
["spokenTestid"]=> # 口 语准考 证号
string(15) "F12345678901234"
["spokenGrade"]=> # 口 语等级
string(3) "C+"
["source"]=>
string(7) "99sushe"
}
<?php
require_once __DIR__ .'/vendor/autoload.php';
$code = new Qianlongzt\Cet\CetSchoolCode();
var_dump($code->getName('3303070'));
sample output like this
array(1) {
[0]=>
string(24) "杭州 电子科技 大学 "
}
The MIT License. Please see License File for more information.