经典语录
如初助手API

接口地址: https://www.58.linkpc.net/api/jdyl

返回格式: 请看返回示例

请求方式: GET

请求示例: https://www.58.linkpc.net/api/jdyl

请求参数说明:

名称 必填 类型 说明
string

返回参数说明:

名称 类型 说明

返回示例:

这个世界上有很多事情是不值得我们花心思去焦虑和困扰的,所以千万不要为了那些无关紧要的人,无关紧要的事,让自己陷入无限的纠结和愤怒之中,毕竟它们在我们以后的人生中是微乎其微,不值一提的。要尽量的把我们的时间和精力,留给我们深爱着的人和事。 - -扶南

错误码格式说明:

名称 类型 说明

代码示例:

<?php
header('Content-type: application/json; charset=utf-8');
date_default_timezone_set('PRC');
$url = 'https://58.linkpc.net/api/jdyl';
$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;
}
}
?>