Skip to content

Instantly share code, notes, and snippets.

@irazasyed
irazasyed / strpos_arr.php
Created July 12, 2013 17:21
PHP: Strpos Array, Find in array!
<?php
/* strpos that takes an array of values to match against a string note the stupid argument order (to match strpos) */
function strpos_arr($haystack, $needle) {
if(!is_array($needle)) $needle = array($needle);
foreach($needle as $what) {
if(($pos = strpos($haystack, $what))!==false) return $pos;
}
return false;
}
@CodeBrauer
CodeBrauer / fix_umlaute.php
Last active January 31, 2024 07:48 — forked from pepebe/gist:4554926
SQL: Repair German "Umlaute" inside a MySQL Database. (mysqli version / PHP7 supported)
<?php
/**
* Alle kaputten Umlaute reparieren bei Umstellung von ISO->UTF8
* Source: http://xhtmlforum.de/66480-kleines-skript-alle-umlaute-der-datenbank.html
*
* @project -
* @author Boris Bojic <[email protected]>
* @copyright Copyright (c) 2011, Boris Bojic (DevShack)
* @version Fri, 23 Dec 2011 13:47:11 +0100
* @updated -