Last active
December 10, 2015 01:28
-
-
Save skwashd/4358987 to your computer and use it in GitHub Desktop.
Output PHP alias functions as a PHP array string. Code based on a conversation with klausi on #drupal-contribute.
This file contains hidden or 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 | |
/** | |
* Extract list of PHP function aliases and output it as a PHP array string. | |
*/ | |
$source = file_get_contents('http://sprunge.us/EaEe'); | |
$xml = new SimpleXMLElement($source); | |
echo "<php\n\$alises = array(\n"; | |
foreach ($xml->para[1]->table->tgroup->tbody->row as $row) { | |
echo " '{$row->entry[0]}' => '{$row->entry[1]->function}',\n"; | |
} | |
echo ");\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment