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
<?php | |
/** | |
* Parse a set of HTTP headers | |
* | |
* @param array The php headers to be parsed | |
* @param [string] The name of the header to be retrieved | |
* @return A header value if a header is passed; | |
* An array with all the headers otherwise | |
*/ | |
function parseHeaders(array $headers, $header = null) { |
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
echo json_decode('"\u30FB"'); |
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
<?php | |
/** | |
* Created by PhpStorm. | |
* User: Youi | |
* Date: 7/25/2015 | |
* Time: 8:44 PM | |
*/ | |
$s = "\x21\xff thing\n\t\\字"; |
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
undefined | |
null | |
0 | |
-0 | |
NaN | |
''(empty string) |
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
<?php | |
function get_redirect_url($url) { | |
stream_context_set_default(array( | |
'http' => array( | |
#'method' => 'HEAD', | |
'request_fulluri' => true, | |
'proxy' => 'tcp://127.0.0.1:1080' | |
) | |
)); |
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
//task killer | |
taskkill [/s Computer] [/u Domain\User [/p Password]]] [/fi FilterName] [/pid ProcessID]|[/im ImageName] [/f][/t] |
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
google.com | |
youtube.com | |
google.com.hk | |
googleusercontent.com | |
googleapis.com | |
googlesyndication.com | |
google-analytics.com | |
googlevideo.com | |
gstatic.com | |
ggpht.com |
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
x+'' //convert to string | |
+x //convert to number | |
!!x //convert to boolean | |
//generate short random string | |
Math.random().toString(36).slice(-5) | |
//generate random ports | |
((Math.random() + 1) / 2 * 65535).toString().slice(0, 5) |
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
<?php | |
$s = preg_replace('^(([ \r\n\t])*( )*)*', '', $s); | |
$s = preg_replace('(([ \r\n\t])*( )*)*$', '', $s); |
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
<?php | |
/** | |
* Convert bytes to human readable format | |
* | |
* @param integer bytes Size in bytes to convert | |
* @return string | |
*/ | |
function bytesToSize($bytes, $precision = 2) | |
{ |
OlderNewer