Created
July 31, 2012 02:17
-
-
Save kijtra/3212844 to your computer and use it in GitHub Desktop.
[MySQL] 文字列の改行(と改行タグ)を削除。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER // | |
DROP FUNCTION IF EXISTS `STRIP_BREAKS`// | |
CREATE FUNCTION `STRIP_BREAKS`(`_str` TEXT) RETURNS TEXT COMMENT '改行の削除' | |
BEGIN | |
RETURN REPLACE(REPLACE(REPLACE(REPLACE(_str,CHAR(13),''),CHAR(10),''),'<br>',''),'<br />',''); | |
END | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment