Skip to content

Instantly share code, notes, and snippets.

@swas
swas / gist:10643194
Created April 14, 2014 12:25
PHP replacing special characters like à->a, è->e
// http://stackoverflow.com/questions/10152894/php-replacing-special-characters-like-a-a-e-e?answertab=votes#tab-top
// PHP.net User notes
<?php
$string = "ʿABBĀSĀBĀD";
echo iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $string);
// output: [nothing, and you get a notice]
echo iconv('UTF-8', 'ISO-8859-1//IGNORE', $string);
@swas
swas / gist:9330554
Created March 3, 2014 17:53
Remove UTF-8 Byte Order Mark BOM
find . -type f -regex '.*html$' -exec sed -i 's/\xEF\xBB\xBF//' '{}' \;
@swas
swas / imagecow.php
Created October 22, 2012 19:31
Imagecow CodeIgniter library
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
include('imagecow_loader.php');
use Fol\Loader;
use Imagecow\Image;
Loader::setLibrariesPath(__DIR__);