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 | |
| $im = imagecreatetruecolor(1, 1); | |
| header('Content-Type: image/gif'); | |
| imagegif($im); | |
| imagedestroy($im); | |
| echo str_pad('a',1000000); |
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 | |
| header('Not Found', true, 404); | |
| header('Content-Type: image/gif'); | |
| $im = imagecreatetruecolor(10, 10); | |
| imagegif($im); | |
| imagedestroy($im); |
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 | |
| var_dump( | |
| array(1,2) == array(1,2), // true | |
| array(1,2) === array(1,2), // true | |
| array(1,2) == array(2,1), // false | |
| array(1,2) === array(2,1), // false | |
| array('a'=>1,'b'=>2) == array('a'=>1,'b'=>2), // true | |
| array('a'=>1,'b'=>2) === array('a'=>1,'b'=>2), // true |
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 | |
| $a = array( | |
| array(1,2,3), | |
| array(1,2,3), | |
| array(4,5,6), | |
| ); | |
| print_r(array_unique($a)); | |
| // Array | |
| // ( |
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
| <script type="text/javascript"> | |
| $(document).bind("mobileinit", function(){alert(1)}); | |
| </script> |
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
| $('<ul data-role="listview"><li>ほげ</li><li>ふが</li></ul>').appendTo($('#入れ込む先のID')).page(); |
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 check($s){ | |
| return strlen($s) !== strlen(mb_convert_encoding(mb_convert_encoding($s,'SJIS','UTF-8'),'UTF-8','SJIS')); | |
| } |
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
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| my @list = (1,2,3,4); | |
| my $str = 'unko'; | |
| func1( @list, $str); | |
| func2( \@list, $str); |
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 | |
| echo get_htdigest('test','aaa','test'); | |
| function get_htdigest($id, $relm, $pass) { | |
| return "$id:$relm:" . md5("$id:$relm:$pass"); | |
| } |
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 | |
| $base_dir = '/path/to/'; | |
| $cmd = 'find ' . $base_dir . ' -type f -regex ".*\.\(html\|jpg\|gif\|txt\|css\)\?.*$" -print0 | xargs -0 ls'; | |
| $path_list = explode("\n", shell_exec($cmd)); | |
| foreach ( $path_list as $path ) { | |
| if ($path !== '') { | |
| $rename_path = preg_replace("/\?.*$/u", '', $path); | |
| rename($path, $rename_path); | |
| } |