摘要: $where="(left(`type_id`,1)=1";返回 type_id 字段 从左边开始长度为1个字符LEFT(str,len)返回字符串str的最左面len个字符。mysql> select LEFT('foobarbar', 5); -> 'fooba'该函数是多字节可靠的。RIGHT(str,len)返回字符串str的最右面len个字符。mysql> select RIGHT('foobarbar', 4); -> 'rbar'该函数是多字节可靠的。之前还真没用过。很有用 阅读全文
posted @ 2013-12-04 18:21 船到桥头 阅读(361) 评论(0) 推荐(0) 编辑
摘要: $file_ext = strtolower(substr(strrchr($upload_file, '.'), 1));strrchr:查找指定字符在字符串中的最后一次出现 string strrchr(string $haystack, mixed $needle) $needle 为指定字符串 返回$haystack 字符串中的一部分,这部分以 $needle 的最后出现位置开始,直到 $haystack 末尾substr:返回字符串的子串 string substr (string $string, int $start[, int $length]) ... 阅读全文
posted @ 2013-12-04 17:49 船到桥头 阅读(342) 评论(0) 推荐(0) 编辑