组保留的标签 余下为需要删除的标签
unset($oldtag[$key]);
}
}
}
if (!empty($oldtag)) {
$tagids = array();
foreach ($oldtag as $tagid => $tagname) {
$tagids[] = $tagid;
}
well_oldtag_delete($tagids, $tid);
}
$r = well_tag_process($tid, $fid, $create_tag, $tagarr);
return $r;
}
// 删除标签和绑定的主题
function well_oldtag_delete($tagids, $tid)
{
$pagesize = count($tagids);
$arrlist = well_tag_find_by_tagids($tagids, 1, $pagesize);
$delete_tagids = array(); // 删除
$tagids = array();
$n = 0;
foreach ($arrlist as $val) {
++$n;
if (1 == $val['count']) {
// 只有一个主题
$delete_tagids[] = $val['tagid'];
} else {
$tagids[] = $val['tagid'];
}
}
!empty($delete_tagids) and well_tag_delete($delete_tagids);
$arlist = well_tag_thread_find_by_tid($tid, 1, $n);
if ($arlist) {
$ids = array();
foreach ($arlist as $val) $ids[] = $val['id'];
well_tag_thread_delete($ids);
}
!empty($tagids) and well_tag_update($tagids, array('count-' => 1));
}
// 标签数据处理 $arr=新提交的数组 $tagarr=保留的旧标签
function well_tag_process($tid, $fid, $new_tags = array(), $tagarr = array())
{
if (empty($tid)) return '';
// 新标签处理入库
if ($new_tags) {
$threadarr = array();
$tagids = array();
$i = 0;
$size = 5;
$n = count($tagarr);
$n = $n > $size ? $size : $size - $n;
foreach ($new_tags as $name) {
++$i;
$name = trim($name);
$name = stripslashes($name);
$name = strip_tags($name);
$name = str_replace(array(' ', '#', "@", "$", "%", "^", '&', '·', '<', '>', ';', '`', '~', '!', '¥', '……', ';', '?', '?', '-', '—', '_', '=', '+', '.', '{', '}', '|', ':', ':', '、', '/', '。', '[', ']', '【', '】', '‘', ' ', ' ', ' ', ' ', ' '), '', $name);
$name = htmlspecialchars($name, ENT_QUOTES);
if ($name && $i <= $n) {
// 查询标签
$read = well_tag_read_name($name);
if ($read) {
// 存在 count+1
$tagids[] = $read['tagid'];
} else {
// 入库
$arr = array('name' => $name, 'count' => 1);
$tagid = well_tag_create($arr);
FALSE === $tagid and message(-1, lang('create_failed'));
$read = array('tagid' => $tagid, 'name' => $name);
}
$tag_thread = array('tagid' => $read['tagid'], 'tid' => $tid);
$threadarr[] = $tag_thread;
$tagarr[$read['tagid']] = $read['name'];
}
}
!empty($threadarr) and tag_thread_big_insert($threadarr);
!empty($tagids) and well_tag_update($tagids, array('count+' => 1));
}
$json = empty($tagarr) ? '' : xn_json_encode($tagarr);
return $json;
}
?> $v = implode(",", $v);
$temp[] = $v;
}
// 去掉重复的字符串,也就是重复的一维数组
$temp = array_unique($temp);
// 再将拆开的数组重新组装
$output = array();
foreach ($temp as $k => $v) {
if ($stkeep) $k = $starr[$k];
if ($ndformat) {
$temparr = explode(",", $v);
foreach ($temparr as $ndkey => $ndval) $output[$k][$ndarr[$ndkey]] = $ndval;
} else $output[$k] = explode(",", $v);
}
return $output;
}
// 合并二维数组 如重复 值以第一个数组值为准
function array2_merge($array1, $array2, $key = '')
{
if (empty($array1) || empty($array2)) return NULL;
$arr = array();
foreach ($array1 as $k => $v) {
isset($v[$key]) ? $arr[$v[$key]] = array_merge($v, $array2[$k]) : $arr[] = array_merge($v, $array2[$k]);
}
return $arr;
}
/*
* 对二维数组排序 两个数组必须有一个相同的键值
* $array1 需要排序数组
* $array2 按照该数组key排序
* */
function array2_sort_key($array1, $array2, $key = '')
{
if (empty($array1) || empty($array2)) return NULL;
$arr = array();
foreach ($array2 as $k => $v) {
if (isset($v[$key]) && $v[$key] == $array1[$v[$key]][$key]) {
$arr[$v[$key]] = $array1[$v[$key]];
} else {
$arr[] = $v;
}
}
return $arr;
}
?>
英语年份的读法编程频道|福州电脑网
英语年份的读法
系统教程780
更新时间:2026-04-03 20:24:28 2024年4月28日发(作者:)
英语中 年份、日期、时间与数字”的读法
陈导发布于
:2009-08-20 16:07
1.
年份
关于四位数年份的读法有下列几种情形:
1)
一般情况下,将表示年份的四个数字按前后分为两组,每一组的数字都 按基数词来
读。例如:
1865
年读作
eighteen sixty-five
(1976 : nineteen seventy-six.
1998
年读作
nineteen ninety-eight
2)
如果前两个数字为非 零”数字,后两位数分别为 零”,则先读出前两位 数,然后
将后面的两个 零”读为
hundred
o
例如:
1900
年读作
nineteen hundred
1800
年读作
eighteen hundred
3)
第三个数字为 零”(其他数字不是 零”)的年份的读法应当将该 零”读 为
O [u]
。
例如:
1809
年读作
eighteen O nine
4)
关于千年的一些读法。
2000
年读作
two thousand
2008
年读作
two thousand and eight
(或
twenty O eight)
1008
年读作
one thousand and eight
(或
ten O eight)
1 / 10
另外,还有一些非四位数的年份,它们有两种读法:一种是按照基数词的 方法来读,另
一种是一个一个数字来读。例如:
531BC
读作
five three one BC (
或
five hundred and thirty-one BC)
since the
2.
日期
“1950
季‘:在
20
世纪
50
年代”之后
英语日期的读法、写法和汉语不同,要注意区别。英语中年、月、日的表 达方法是 月
份
+
序数词,年”。
2001
年
4
月
2
日应该写成:
April 2nd, 2001
,读 成:
April the second,
twothousandandone
。一般情况下,序数词是在基数词后加
-th
,但有几种特殊情况,可按下
面规律来记:
1
、
2
、
3
单独记(即
first, second,
third) , 8
后少
t, 9
少
e
(即:
eighth, ninth) , 5
、
12
变
ve
为
fth
(即
fifth, twelfth )
,整十位数变
y
为
ie
再力口
th
(如
twentieth ),
二位以上只将个数变序 数词(如
thirty-second)
。
例如:
October 31 (October 31st)
读作
October (the) thirty-first
August 26 (August 26th)
读作
August (the) twenty-sixth
3.
时间
时间的读法有以下一些特点:
1)
可以直接按照表示时间的数字来读。例如:
10: 56
读作
ten fifty six
8: 30
读作
eight thirty
2)
正点后的前半小时,通常说几点 过”
(past)
几
分。例如:
9: 25
读作
twenty-five past nine
2 : 16
读作
sixteen past two
2 / 10
本文发布于:2024-04-28,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数字读法年份来读表示
发布评论