$reserves=[];
if($reserveStrs!=""){
$reserves = explode(',',$reserveStrs);
}
foreach($list as $key => $item) {
$reserveFields = [];
foreach($reserves as $name){
$reserveFields[$name] = $item[$name];
}
$newList[]=[...$item[$keyName],...$reserveFields];
}
$newList=setCurLangForList($newList);
return $newList;
}
//获得当前语言的值,例如当前语言为cn,传入 $info=array,$fieldName=name,则返回 $info['cn_name'] 的值
function getCurLangValue($info,$fieldName){
//获得当前语言标识
$curLangIdentifier = lang('identifier');
lang | cn |
id | 16 |
USER | www |
HOME | /home/www |
HTTP_CONTENT_TYPE | application/x-www-form-urlencoded |
HTTP_CONTENT_LENGTH | 5 |
HTTP_COOKIE | |
HTTP_ACCEPT | */* |
HTTP_HOST | cn.tcmcb.com |
PATH_INFO | |
REDIRECT_STATUS | 200 |
SERVER_NAME | cn.tcmcb.com |
SERVER_PORT | 443 |
SERVER_ADDR | 172.31.126.252 |
REMOTE_PORT | 41618 |
REMOTE_ADDR | 47.242.177.151 |
SERVER_SOFTWARE | nginx/1.24.0 |
GATEWAY_INTERFACE | CGI/1.1 |
HTTPS | on |
REQUEST_SCHEME | https |
SERVER_PROTOCOL | HTTP/1.1 |
DOCUMENT_ROOT | /home/wwwroot/tcmcb.com/public |
DOCUMENT_URI | /api.php |
REQUEST_URI | /api.php?s=article/getInfo&lang=cn |
SCRIPT_NAME | /api.php |
CONTENT_LENGTH | 5 |
CONTENT_TYPE | application/x-www-form-urlencoded |
REQUEST_METHOD | POST |
QUERY_STRING | s=article/getInfo&lang=cn |
SCRIPT_FILENAME | /home/wwwroot/tcmcb.com/public/api.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | |
REQUEST_TIME_FLOAT | 1726788784.69 |
REQUEST_TIME | 1726788784 |