A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
A list of amazingly awesome PHP libraries, resources and shiny things.
| <?php | |
| // | |
| // this gist takes most of the code from https://gist.github.com/3176917 but adds in form uploading which is just an @ symbol | |
| // this also explores different options for the form data | |
| // | |
| // curl_post_upload.php | |
| // You can modify this script to make PHP use a webpage like a person sitting | |
| // at a computer would use a webpage. | |
| // | |
| // tags: #php #curl #form #upload |
| <?php | |
| function getSlug($text) | |
| { | |
| $text = preg_replace('~[^\\pL\d]+~u', '-', $text); | |
| $text = trim($text, '-'); | |
| $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); | |
| $text = strtolower($text); | |
| $text = preg_replace('~[^-\w]+~', '', $text); | |
| if (empty($text)) | |
| { |
| <?php | |
| $ip='94.219.40.96'; | |
| print_r(geoCheckIP($ip)); | |
| //Array ( [domain] => dslb-094-219-040-096.pools.arcor-ip.net [country] => DE - Germany [state] => Hessen [town] => Erzhausen ) | |
| //Get an array with geoip-infodata | |
| function geoCheckIP($ip) | |
| { | |
| //check, if the provided ip is valid | |
| if(!filter_var($ip, FILTER_VALIDATE_IP)) |