PHP 函数 show_result() 添加网址前缀
PHP 函数 show_result() 添加网址前缀
可以通过在 show_result 函数中添加一个网址前缀来实现在输出值前面加上网址的效果。
修改后的代码如下:
function show_result($code,$msg,$result){
global $format;
$url_prefix = 'http://whsc.gay/';
if ($format === 'txt') {
if ($code === 0 ){
exit($url_prefix.$msg);
}else{
exit($url_prefix.$code);
}
}else{
$result=array('code'=>$code,'msg'=>$url_prefix.$msg,'result'=>$result);
exit(json_encode($result));
}
}
在调用 show_result 函数时,输出值会在网址 'http://whsc.gay/' 后面。
原文地址: https://www.cveoy.top/t/topic/byoL 著作权归作者所有。请勿转载和采集!