<?php

/*
 * Parser
 * Copyright 2019 TopWebStudio. All Rights Reserved.
 * Distribution allowed only with licensing permission
 * contact@topwebstudio.com  
 */

namespace Topwebstudio\Parsers;

class Parser {

    protected $content;

    protected function trim($var) {
        if (is_array($var)) {
            return array_map(array($this, 'trim'), $var);
        }
        return trim(preg_replace("/\n\r+/", '', $var));
    }

    function recursive_ksort(&$array) {
        if (!empty($array)) {
            foreach ($array as $k => &$v) {
                if (is_array($v)) {
                    $this->recursive_ksort($v);
                }
            }
            return ksort($array);
        }
    }

}
