Skip to content

Instantly share code, notes, and snippets.

hakre hakre

View GitHub Profile
@nikic
nikic / php_evaluation_order.md
Last active Apr 15, 2019
Analysis of some weird evaluation order in PHP
View php_evaluation_order.md

Order of evaluation in PHP

Yesterday I found some people on my [favorite reddit][lolphp] wonder about the output of the following code:

<?php

$a = 1;
$c = $a + $a++;
@ircmaxell
ircmaxell / equality.php
Last active Apr 19, 2019
Unicode Set Functions
View equality.php
<?php
const= true;
const= false;
function ≠($left, $right) {
return $left != $right;
}
function ≅($left, $right) {
@MadaraUchiha
MadaraUchiha / mysql_comment.markdown
Last active Apr 15, 2019
Don't use MySQL functions in PHP - Comment for Stack Overflow
View mysql_comment.markdown
[**Please, don't use `mysql_*` functions in new code**](http://bit.ly/phpmsql). They are no longer maintained [and are officially deprecated](http://j.mp/XqV7Lp). See the [**red box**](http://j.mp/Te9zIL)? Learn about [*prepared statements*](http://j.mp/T9hLWi) instead, and use [PDO](http://php.net/pdo) or [MySQLi](http://php.net/mysqli) - [this article](http://j.mp/QEx8IB) will help you decide which. If you choose PDO, [here is a good tutorial](http://j.mp/PoWehJ).

Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.

@hakre
hakre / bopypad.md
Last active Oct 5, 2015
SO copypad
View bopypad.md

This question appears to be off-topic because it is about ...

Tutoring with a software named Wordpress, here a Tutorial for Extending it with a specific Plugin and an individual Theme.

Tutoring a Software Product named Magento.

a very individual problem without given any further reference to commons in programming in a useful manner. See also: Stack Overflow question checklist

a Debugging request of larger chunks of non-isolated code that may (or may not) contain the code the question asks about. Instead the code should be reduced the a bare minimum example code that outlines the problem and question in a compact and self-explaining manner.

View special-background.php
<?php
/**
* Special Background Wordpress Plugin
*
* @-wp-header Plugin Name: Special Background
* @-wp-header Plugin URI: http://wordpress.stackexchange.com/questions/972/
* @-wp-header Description: Example to show how to add a special background using exiting background admin page in core.
* @-wp-header Version: 0.2
* @-wp-header Author: Mike Schinkel, hakre
* @-wp-header Author URI: http://mikeschinkel.com/custom-wordpress-plugins/
@evaisse
evaisse / remove_accents.function.php
Created Aug 18, 2009
php function to remove accent from the input string string. An example string like `ÀØėÿᾜὨζὅБю` * will be translated to `AOeyIOzoBY`
View remove_accents.function.php
<?php # -*- coding: utf-8 -*-
// function remove_accents()
/**
* Unaccent the input string string. An example string like `ÀØėÿᾜὨζὅБю`
* will be translated to `AOeyIOzoBY`. More complete than :
* strtr( (string)$str,
* "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ",
* "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn" );
*
You can’t perform that action at this time.