Skip to content

Instantly share code, notes, and snippets.

View macik's full-sized avatar

Andrey Matsovkin macik

View GitHub Profile
@macik
macik / array_keys_prefix.php
Created December 29, 2012 19:15
// changes all array keys to keys with prefix
<?php
$a = array('a1'=>'1','a2'=>2);
// changes all array keys to keys with prefix
$prefix = 'page_';
$a = array_combine(explode(',', $prefix.implode(','.$prefix, array_keys($a))), array_values($a));
print_r($a);
/*
@macik
macik / convert_for_mb.php
Created December 25, 2012 11:26
Converts old string PHP functions for multibyte anologs.
<?php
$filename = 'header.php'; // File name
$search[] = 'mail('; $replace[] = 'mb_send_mail(';
$search[] = 'strlen('; $replace[] = 'mb_strlen(';
$search[] = 'strpos('; $replace[] = 'mb_strpos(';
$search[] = 'strrpos('; $replace[] = 'mb_strrpos(';
$search[] = 'substr('; $replace[] = 'mb_substr(';
$search[] = 'strtolower('; $replace[] = 'mb_strtolower(';
$search[] = 'strtoupper('; $replace[] = 'mb_strtoupper(';
@macik
macik / message.php
Created November 13, 2012 15:59
fix for message.php
<?php
/**
* System messages and redirect proxy
*
* @package Cotonti
* @version 0.9.0
* @author Cotonti Team
* @copyright Copyright (c) Cotonti Team 2008-2012
* @license BSD
@macik
macik / dabblet.css
Created October 10, 2012 17:03
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;