在mysql中,如果你这样做:
CREATE TABLE `foo` (`text` VARCHAR(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `foo` (`text`) VALUES ('Foo'), ('foo'), ('tel'), ('tél');
SELECT `text`, COUNT(*) AS `num` FROM `foo` GROUP BY `text`
你会得到这个:
+------+-----+
| text | num |
+------+-----+
| Foo | 2 |
| tel | 2 |
+------+-----+
或:
SELECT * FROM `foo` WHERE `text` = 'tel';
结果:
+------+
| text |
+------+
| tel |
| tél |
+------+
现在,在php中,有没有办法获得类似的?
E.g。检查'tel'
和'tél'
是否相等会导致true
?