Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class XML {
- public static function encode($array) {
- $return = '';
- foreach($array as $key => $item){
- $return .= '<' . $key . '>';
- if(is_array($item))
- $return .= self::encode($item);
- else
- $return .= "{$item}";
- $return .= '</' . $key . '>';
- }
- return $return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement