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 | |
| $data = new DBTable('dsdada'); | |
| $data->type = 'color'; | |
| $data->name = 'green'; | |
| $array = array | |
| ( | |
| 'id' => 123, |
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 | |
| ini_set('display_errors', 1); | |
| error_reporting(E_ALL); | |
| define('UPLOAD_DIRECTORY', 'uploads/'); // directory path for the uploads | |
| define('UPLOAD_HASH', md5(time())); | |
| if (isset($_FILES['file']['name'])) | |
| { |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>File Uploader Example</title> | |
| <script src="//code.jquery.com/jquery-1.9.1.js"></script> | |
| <script type="text/javascript"> | |
| function submitForm() | |
| { | |
| var fd = new FormData(document.getElementById("fileinfo")); | |
| fd.append("label", "WEBUPLOAD"); |
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 | |
| $result = function ($arg1 = false, $arg2 = false) | |
| { | |
| return 'function works'; | |
| }; | |
| $if = function ($condition, $true, $false) { return $condition ? $true : $false; }; | |
| // - #################################### |
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 | |
| // Define routes | |
| $routes = array | |
| ( | |
| '\/' => function() { return '<a href="/hello">Click here for a greeting</a>'; }, | |
| '\/hello' => function() { return 'Hello world'; }, | |
| '\/count\/(\d+)' => function($count) { return join("<br>", range(1, $count)); }, | |
| '404' => function() { return 'Page not found'; } | |
| ); |
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 get_post_attachments($post_parent_id, $numberpost = -1, $posts_status = NULL) | |
| { | |
| $args = array | |
| ( | |
| 'post_type' => 'attachment', | |
| 'numberposts' => $numberpost, | |
| 'post_status' => $posts_status, | |
| 'post_parent' => $post_parent_id |
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 | |
| public function rules() | |
| { | |
| $user = User::find($this->users); | |
| switch($this->method()) | |
| { | |
| case 'GET': | |
| case 'DELETE': |
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
| SELECT Concat('ALTER TABLE ', TABLE_NAME, ' RENAME TO my_prefix_', TABLE_NAME, ';') | |
| FROM information_schema.tables WHERE table_schema = 'my_database' |
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 | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Session; | |
| use App; | |
| use Config; | |
| class SetLocale |
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
| var ip2long = function(a,b,c,d){for(c=b=0;d=a.split('.')[b++];)c+=-256&d|b>4?NaN:d*(1<<-8*b);return c}; | |
| alert(ip2long('83.99.17.115')); |