Skip to content

Instantly share code, notes, and snippets.

@hakre
hakre / csv-to-xml.php
Created August 16, 2015 12:13
Converting a massive CSV to a specific XML format
<?php
/*
* Converting a massive CSV to a specific XML format
*
* @link http://stackoverflow.com/a/32034227/367456
*/
/**
* Class XmlEncoder
*
@rintaun
rintaun / closurize.php
Created May 23, 2012 03:50
closurize(): Converts any valid PHP callable into a Closure. Requires PHP 5.4.0+.
<?php
/**
* Converts any valid PHP callable into a Closure. Requires PHP 5.4.0+.
*
* The ramifications of this are many, but basically it means that any function
* or method can be converted into a Closure, bound to another scope, and
* executed easily. Works properly even with private methods.
*
* - On success, returns a Closure corresponding to the provided callable.
* - If the parameter is not callable, issues an E_USER_WARNING and returns a