This commit is contained in:
wangjinlei
2021-07-15 10:23:11 +08:00
parent e8862b2807
commit 0fd546dfbb
5 changed files with 128 additions and 49 deletions

View File

@@ -20,6 +20,25 @@ function authcode($str) {
return md5($key . $str1);
}
/**
* 对象 转 数组
*
* @param object $obj 对象
* @return array
*/
function object_to_array($obj) {
$obj = (array)$obj;
foreach ($obj as $k => $v) {
if (gettype($v) == 'resource') {
return;
}
if (gettype($v) == 'object' || gettype($v) == 'array') {
$obj[$k] = (array)object_to_array($v);
}
}
return $obj;
}
/**
* @function sendEmail
* @intro 发送邮件(带附件)