稳定、快速、免费的 API 接口服务
如初助手API
接口地址: https://www.58.linkpc.net/api/mryy/mryy
返回格式: 请看返回示例
请求方式: GET
请求示例: https://www.58.linkpc.net/api/mryy
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
time | 否 | string | 需要查询的日期(默认今日) |
hh | 否 | string | 换行符号(默认 ) |
返回参数说明:
名称 | 类型 | 说明 |
---|
返回示例:
https://staticedu-wps.cache.iciba.com/image/823d575f93bb2fd7b81b29418a100062.png
中文:爱,让生命有了意义。
英文:Love is what makes life worth living.
语音:https://staticedu-wps.cache.iciba.com/audio/a1484cd727c374d1aaba5351d2891ab2.mp3
更新时间::2025-02-23
错误码格式说明:
名称 | 类型 | 说明 |
---|
代码示例:
<?php
header('Content-type: application/json; charset=utf-8');
date_default_timezone_set('PRC');
$url = 'https://58.linkpc.net/api/mryy';
$type = isset($_GET['type']) ? $_GET['type'] : '';
if ($type == 'json' || $type == 'JSON') {
$result = file_get_contents($url . '?type=json');
echo $result;
} else {
// 使用cURL获取URL内容
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
// 检查内容类型并输出相应内容
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);
if (strpos($contentType, 'image') !== false) {
// 输出图片
header('Content-Type: ' . $contentType);
echo $response;
} elseif (strpos($contentType, 'text') !== false) {
// 输出文字
header('Content-Type: ' . $contentType);
echo $response;
} elseif (strpos($contentType, 'application/json') !== false) {
// 输出JSON
header('Content-Type: application/json');
echo $response;
} else {
// 输出网页返回内容
header('Content-Type: text/html');
echo $response;
}
}
?>