Skip to content

Instantly share code, notes, and snippets.

View RKAN's full-sized avatar

Serkan Camur RKAN

  • Bitberry GmbH
  • Vienna
View GitHub Profile
@RKAN
RKAN / awesome-php.md
Created July 19, 2013 16:05 — forked from ziadoz/awesome-php.md
# Awesome PHP A list of amazingly awesome PHP libraries, resources and shiny things.

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

<?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
@RKAN
RKAN / slugify_text.php
Created July 19, 2013 15:53
slugify text
<?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))
{
@RKAN
RKAN / get_geo_info
Created July 19, 2013 15:51
Get Geo-IP Information
<?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))