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
| class ArrayToXML | |
| { | |
| /** | |
| * The main function for converting to an XML document. | |
| * Pass in a multi dimensional array and this recrusively loops through and builds up an XML document. | |
| * Based on: http://snipplr.com/view/3491/convert-php-array-to-xml-or-simple-xml-object-if-you-wish/ | |
| * | |
| * @param array $data | |
| * @param string $rootNodeName - what you want the root node to be - defaultsto data. | |
| * @param SimpleXMLElement $xml - should only be used recursively |
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 | |
| /** | |
| * This is an example of a practical encoder and decoder for base-62 data in PHP | |
| * It differs from the majority of examples in that it's fast enough for moderate data sizes, unlike multiprecision converters | |
| * To be practical, base-62 encoding needs to use internal chunking and padding because base-62 does not fit exactly into any integral number of bits | |
| * This means the output is not quite compatible with multiprecision conversions, | |
| * but the encoded data retains all the desirable properties of base-62, so (unlike any base-64 encoding) it's URL, DNS, email address and pathname safe | |
| * @author Marcus Bointon <[email protected]> | |
| * @copyright 2011 Marcus Bointon | |
| * @license http://www.opensource.org/licenses/mit-license.html MIT License |
NewerOlder