1 回答
TA贡献1830条经验 获得超3个赞
您可以利用 ASCII 表:
<?php
//Number of rows and columns
$rows = 3;
$cols = 40;
$pcoords = array();
for($current_row=1;$current_row<$rows+1;$current_row++) {
$alpha_index = 65;
$alpha_pref_index = 65;
$alpha_count = 0;
$pref_letter = '';
for($current_col=0;$current_col<$cols;$current_col++) {
$col_letter = chr($alpha_index);
$pcoords[] = $pref_letter . $col_letter. $current_row;
$alpha_count++;
if ($alpha_count == 26) {
$alpha_count = 0;
$alpha_index = 65;
$pref_letter = chr($alpha_pref_index);
$alpha_pref_index++;
}
else {
$alpha_index++;
}
}
}
echo '<pre>';
print_r($pcoords);
echo '</pre>';
- 1 回答
- 0 关注
- 60 浏览
添加回答
举报