initial commit

This commit is contained in:
Ben Ramey
2017-03-02 21:36:05 -06:00
commit e85327b977
1953 changed files with 176586 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
################################################### FUNCTION: xml_random_child #
function xml_random_child($xml_file)
{
$xml = xml_get_from_file($xml_file);
$children = $xml->children();
$count = count($children);
return($children[rand(0,$count-1)]);
}
################################################## FUNCTION: xml_get_from_file #
function xml_get_from_file($file_path)
{
if(!file_exists($file_path))
{
trigger_error('XML file "'.$file_path.'" does not exist!');
return NULL;
}
return simplexml_load_file($file_path);
}
?>