Skip to content

Instantly share code, notes, and snippets.

@skwashd
Last active December 10, 2015 01:28
Show Gist options
  • Save skwashd/4358987 to your computer and use it in GitHub Desktop.
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.
<?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