This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Callback Decorator | |
* | |
* Providing reflection and invoking | |
* with named function arguments. | |
* | |
* @version 0.0.1 | |
* @see http://stackoverflow.com/q/8649536/367456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<data> | |
<hello>paste your xml here</hello> | |
</data> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* dl-file.php | |
* | |
* Protect uploaded files with login. | |
* | |
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in | |
* | |
* @author hakre <http://hakre.wordpress.com/> | |
* @license GPL-3.0+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param string $query xpath query/expression | |
* @param string $html (optional) | |
* @return array|FALSE array on success, FALSE on error | |
*/ | |
function xpath_match_all($query, $html = '') | |
{ | |
static $dom; | |
static $xpath; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* TextRange.php - DOMDocument based Textrange and text manipulation | |
* | |
* @author hakre <http://hakre.wordpress.com/credits> | |
* @version 1.1.1 | |
*/ | |
/** | |
* TextRange - Collection of DOMText nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @link http://stackoverflow.com/q/9445369/367456 | |
*/ | |
$array = range('A', 'M'); | |
$columns = 4; | |
$length = count($array); | |
print_matrix($array, $columns); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Some Iterator Fun | |
* | |
* @link http://hakre.wordpress.com/2012/02/28/some-php-iterator-fun/ | |
*/ | |
/** | |
* Iterator that fetches each iteration value from a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Getting nested set model into a <ul> but hiding “closed” subtrees | |
* | |
* @link http://stackoverflow.com/a/7786733/367456 | |
*/ | |
// $categories = get_categories(); | |
$categories = get_categories_large(); | |
$current = array('lft' => '14', 'rgt' => '13'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* XMLRPC Discovery and XMLRPC Introspection Service | |
* | |
* <http://xmlrpc-c.sourceforge.net/introspection.html> | |
* | |
* Uses the PHP XML-RPC extension <http://php.net/manual/en/book.xmlrpc.php> | |
* | |
* Has an adapter interface to other libraries as well, a working example implementation | |
* exists for XML-RPC for PHP <http://phpxmlrpc.sourceforge.net/doc-2/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Magnet links library for PHP | |
* | |
* @link http://stackoverflow.com/questions/6634059/magnet-links-library-for-php | |
*/ | |
$magnetUri = 'magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C'; | |
echo 'Magnet URI demo: ', $magnetUri, "\n\n"; |