A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer
- Composer Related
- Frameworks
- Micro Frameworks
| # Use PHP5 as default | |
| AddHandler application/x-httpd-php5 .php | |
| # 5G BLACKLIST/FIREWALL (2013) | |
| # @ http://perishablepress.com/5g-blacklist-2013/ | |
| # 5G:[QUERY STRINGS] | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / |
السلام عليكم ، هذا كود ريجيكس بسيط للتحقق من صحة أرقام الجوالات السعودية ، يقوم الريجيكس بالتحقق من مفتاح الدولة ، مفتاح شركة الإتصالات لضمان صحة النص المدخل .
Hello, this is a simple regex to validate saudi mobile numbers, the code will validate country code, telecome company code and make sure the tested sting is correct .
/^(009665|9665|\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})$/
| <?php | |
| //Simple Ajax Login Form | |
| //Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/ | |
| ?> | |
| //html | |
| <form id="login" action="login" method="post"> | |
| <h1>Site Login</h1> | |
| <p class="status"></p> | |
| <label for="username">Username</label> |
| <?php | |
| add_action('wp_ajax_register_user_front_end', 'register_user_front_end', 0); | |
| add_action('wp_ajax_nopriv_register_user_front_end', 'register_user_front_end'); | |
| function register_user_front_end() { | |
| $new_user_name = stripcslashes($_POST['new_user_name']); | |
| $new_user_email = stripcslashes($_POST['new_user_email']); | |
| $new_user_password = $_POST['new_user_password']; | |
| $user_nice_name = strtolower($_POST['new_user_email']); | |
| $user_data = array( | |
| 'user_login' => $new_user_name, |
| // url is the link for the form view page | |
| // data is the name attribute of the field | |
| $.ajax({ | |
| url: "https://docs.google.com/forms/d/1iqMixtVq4O0AFvYCZHbGerigi1G5Qb3XthXZX9VpNtk/formResponse", | |
| data: { "entry.1679407376": field1}, | |
| type: "POST", | |
| dataType: "xml", | |
| statusCode: { |
| <?php | |
| class Database extends PDO | |
| { | |
| public function __construct($DB_TYPE, $DB_HOST, $DB_NAME, $DB_USER, $DB_PASS) | |
| { | |
| parent::__construct($DB_TYPE.':host='.$DB_HOST.';dbname='.$DB_NAME, $DB_USER, $DB_PASS); | |
| } | |
| <?php | |
| // Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
| // http://youtu.be/dQw4w9WgXcQ | |
| // http://www.youtube.com/embed/dQw4w9WgXcQ | |
| // http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
| // http://www.youtube.com/?v=dQw4w9WgXcQ | |
| // http://www.youtube.com/v/dQw4w9WgXcQ | |
| // http://www.youtube.com/e/dQw4w9WgXcQ | |
| // http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |
| <?php | |
| /** | |
| * ----------------------------------------------------------------------------------------- | |
| * Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php` | |
| * ----------------------------------------------------------------------------------------- | |
| */ | |
| // HTML Minifier | |
| function minify_html($input) { |
| function custom_query_shortcode($atts) { | |
| // EXAMPLE USAGE: | |
| // [loop the_query="showposts=100&post_type=page&post_parent=453"] | |
| // Defaults | |
| extract(shortcode_atts(array( | |
| "the_query" => '' | |
| ), $atts)); |