This file contains hidden or 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
| function isemail($email) { | |
| return strlen($email) > 6 && strlen($email) <= 32 && preg_match("/^([A-Za-z0-9\-_.+]+)@([A-Za-z0-9\-]+[.][A-Za-z0-9\-.]+)$/", $email); | |
| } |
This file contains hidden or 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
| function dir_writeable($dir) { | |
| $writeable = 0; | |
| if(!is_dir($dir)) { | |
| @mkdir($dir, 0777); | |
| } | |
| if(is_dir($dir)) { | |
| if($fp = @fopen("$dir/test.txt", 'w')) { | |
| @fclose($fp); | |
| @unlink("$dir/test.txt"); | |
| $writeable = 1; |
This file contains hidden or 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
| <?php | |
| function formattime($s) { | |
| if(date('Y', $s) < date('Y')) { | |
| return date('Y-n-d H:i', $s); | |
| } elseif(date('G', $s) > date('G')) { | |
| return date('n月d日 H:i', $s); | |
| } | |
| $limit = time() - $s; | |
| if($limit < 60) { | |
| return $limit . '秒前'; |
NewerOlder