ãã©ã¼ã ã®ããªãã¼ã·ã§ã³ãç´ ã®PHPã§èãã¦ã¿ã
ãåãåãããã©ã¼ã ããã¬ã¼ã ã¯ã¼ã¯ãã©ã¤ãã©ãªãªã©ä¸å使ç¨ããã«ãèªåã§ç´ ã®PHPã ãã§å®æãããï¼
ã¨ããæ令ã«ãã1é±éã²ã¼ã²ã¼è¨ã£ã¦ã¾ããã
ãããã客æ§ã¸ç´åããããã°ã©ã ã¨ãã・・・
ããã§ã®TIPSãããã¤ãã
ååãå ¨è§æ¥æ¬èªã§å ¥åããã¦ãããããã§ã㯠preg_match("/(?:\xEF\xBD[\xA1-\xBF]|\xEF\xBE[\x80-\x9F])|[\x20-\x7E]/", $name)
ãµãããªãå ¥åããã¦ããããã§ã㯠preg_match("/^[ã-ã]+$/u", $kana) //å ¨è§ã²ãã㪠preg_match("/^[ã¡-ã¶ã¼]+$/u", $kana) //å ¨è§ã«ã¿ã«ã
ã¡ã¼ã«ã¢ãã¬ã¹ã®ãã§ã㯠preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $mail)
æåæ°ãã§ã㯠$length = mb_strlen($content, "UTF-8"); //æ¥æ¬èªã¨ãã¦ã®æåæ°ãã§ã㯠if ($length < 0 || $length > 40) { //1æå以ä¸40æå以å ã®åå²æ }
ã¨ã¦ããã¾ãã§ãããã©ã¤ãã©ãªããã¬ã¼ã ã¯ã¼ã¯ãããã«ä¾¿å©ããåèªèã§ãã¾ããã
åèï¼http://www.syuhari.jp/blog/archives/418