I hereby claim:
- I am acheng93 on github.
- I am 93jc (https://keybase.io/93jc) on keybase.
- I have a public key ASDvAC2QO5kABTe4RWFde3iC95vFltaN386dBaqBUbJgeQo
To claim this, I am signing this object:
| <?php | |
| function GetIP(){ | |
| if (getenv("HTTP_CLIENT_IP") | |
| && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) | |
| $ip = getenv("HTTP_CLIENT_IP"); | |
| else if (getenv("HTTP_X_FORWARDED_FOR") | |
| && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) | |
| $ip = getenv("HTTP_X_FORWARDED_FOR"); | |
| else if (getenv("REMOTE_ADDR") | |
| && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) |
| <?php | |
| $array1 = array( | |
| 0=>array('id'=>8,'name'=>'Apple','age'=> 18), | |
| 1=>array('id'=>8,'name'=>'Bed','age'=>17), | |
| 2=>array('id'=>5,'name'=>'Cos','age'=>16), | |
| 3=>array('id'=>5,'name'=>'Cos','age'=>14) | |
| ); | |
| function sortArrByManyField(){ | |
| $args = func_get_args(); | |
| if(empty($args)){ |
| <?php | |
| /** | |
| * 思路:先CURL获取图片到缓冲区,然后正则获取图片的Content-Length信息 | |
| * [获取远程图片大小] | |
| * @param [string] $uri [远程图片地址] | |
| * @param string $user [网页授权用户名] | |
| * @param string $pw [网页授权密码] | |
| * @return [string] | |
| */ | |
| function remote_filesize($uri,$user='',$pw='') |
| <?php | |
| date_default_timezone_set('PRC'); | |
| /** | |
| * [时间戳转换成“刚刚”,“5分钟前”,“3小时前”等] | |
| * @param [string] $time [时间戳] | |
| * @return [string] | |
| */ | |
| function transfer_time($time) |
| <?php | |
| function RemoveXSS($val) { | |
| // remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are allowed | |
| // this prevents some character re-spacing such as <java\0script> | |
| // note that you have to handle splits with \n, \r, and \t later since they *are* allowed in some inputs | |
| $val = preg_replace('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '', $val); | |
| // straight replacements, the user should never need these since they're normal characters | |
| // this prevents like <IMG SRC=@avascript:alert('XSS')> | |
| $search = 'abcdefghijklmnopqrstuvwxyz'; |
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| div{ | |
| padding: 6px 16px; | |
| border: 1px solid #446d88; | |
| background: #58a linear-gradient(#77a0bb, #58a); border-radius: 4px; | |
| box-shadow: 0 1px 5px gray; | |
| color: white; | |
| text-shadow: 0 -1px 1px #335166; |