Loading src/functions.php +19 −0 Original line number Diff line number Diff line Loading @@ -660,4 +660,23 @@ if (!function_exists('make_has_relation_function')) { } if (!function_exists('int_to_chr')) { /** * 数字转字母 (类似于Excel列标) * @param $index 索引值 * @param int $start 字母起始值 * @return string 返回字母 */ function int_to_chr($index, $start = 65) { $str = ''; if (floor($index / 26) > 0) { $str .= int_to_chr(floor($index / 26) - 1); } return $str . chr($index % 26 + $start); } } Loading
src/functions.php +19 −0 Original line number Diff line number Diff line Loading @@ -660,4 +660,23 @@ if (!function_exists('make_has_relation_function')) { } if (!function_exists('int_to_chr')) { /** * 数字转字母 (类似于Excel列标) * @param $index 索引值 * @param int $start 字母起始值 * @return string 返回字母 */ function int_to_chr($index, $start = 65) { $str = ''; if (floor($index / 26) > 0) { $str .= int_to_chr(floor($index / 26) - 1); } return $str . chr($index % 26 + $start); } }