Get html of dumped variable.

@param mixed $var

@return bool|string
427547
protected function getDumpedHtml($var)
    {
        ob_start();

        dump($var);

        $content = ob_get_contents();

        ob_get_clean();

        return substr($content, strpos($content, '<pre '));
    }
392599
public static function isEmpty($var) 
	{	
		$toReturn = false;

		if(is_array($var) && empty($var)) {
			$toReturn = true;
		}

		if(is_string($var) && ($var =='' || is_null($var))) {
			$toReturn = true;
		}

		if(is_integer($var) && ($var =='' || is_null($var)) ) {
			$toReturn = true;
		}

		if(is_float($var) && ($var =='' || is_null($var)) ) {
			$toReturn = true;
		}

		return $toReturn;
	}
1254093
protected function getVarDump($var)
    {
        $varType = gettype($var);
        switch ($varType) {
            case 'boolean':
            case 'integer':
            case 'double':
            case 'NULL':
            case 'ressource':
                return print_r($var, 1);
            case 'string':
                return (250 < strlen($var)) ? substr($var, 0, 250).'...' : $var;
            case 'object':
                return 'Object instance of ' . get_class($var);
            case 'array':
                $formated_array = array();

                foreach ($var as $key => $value) {
                    $formated_array[$key] = $this->getVarDump($value);
                }

                return print_r($formated_array, 1);
        }
    }
647562
protected static function var_dump_to_string($var) {
		if(is_string($var))
			return $var;

		ob_start();
		var_dump($var);
		if(ob_get_length() > 1024)
			$str = '['.(is_object($var) ? get_class($var):gettype($var)).' - too big to display]';
		else
			$str = ob_get_contents();
		ob_end_clean();
		return $str;
	}
278425
private function varIsXmlResource($var) {
			$xml_parser=xml_parser_create();
			xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
			xml_set_element_handler($xml_parser,array(&$this,"xmlStartElement"),array(&$this,"xmlEndElement"));
			xml_set_character_data_handler($xml_parser,array(&$this,"xmlCharacterData"));
			xml_set_default_handler($xml_parser,array(&$this,"xmlDefaultHandler"));

			$this->makeTableHeader("xml","xml document",2);
			$this->makeTDHeader("xml","xmlRoot");

		//attempt to open xml file
			$bFile=(!($fp=@fopen($var,"r"))) ? false : true;

		//read xml file
			if($bFile) {
				while($data=str_replace("\n","",fread($fp,4096)))
					$this->xmlParse($xml_parser,$data,feof($fp));
			}
		//if xml is not a file, attempt to read it as a string
			else {
				if(!is_string($var)) {
					echo $this->error("xml").$this->closeTDRow()."</table>\n";
					return;
				}
				$data=$var;
				$this->xmlParse($xml_parser,$data,1);
			}

			echo $this->closeTDRow()."</table>\n";

		}
527409
protected function evalVarDump($variable)
    {
        $dumper = new HtmlDumper;
        $cloner = new VarCloner;

        $output = '<div style="display:none">';
        $output .= $dumper->dump($cloner->cloneVar($variable), true);
        $output .= '</div>';

        return $output;
    }
566743
public static function varInfo($var, $type = NULL) {
    if ($var === NULL) return 'NULL';
    
    $type = self::getType($var);
    
    if ($type == 'string') {
      return sprintf(
        'string(%d) "%s"',
        mb_strlen($var),
        (string) $var
      );
    } elseif ($type == 'array') {
      return sprintf('array(%s)', 
        A::implode($var, ', ',function ($item) {
          return Util::varInfo($item);
        })
      );
    } elseif ($var instanceof Info) {
      return $var->getVarInfo();
    } elseif ($var instanceof \stdClass) {
      return '(object) '.json_encode($var);
    } elseif (is_object($var)) {
      return sprintf('%s(%s)', method_exists($var, '__toString') ? $var->__toString() : 'not converted to string', self::typeInfo($var));
    } elseif (is_bool($var)) {
      return sprintf('boolean(%s)',$var ? 'true' : 'false');
    } else {
      return sprintf('%s(%s)', self::typeInfo($var), (string) $var);
    }
  }
859134
public function sanitize($var)
	{
		global $smcFunc;

		if (is_array($var))
		{
			foreach ($var as $k => $v)
				$var[$k] = $this->sanitize($v);

			return $var;
		}

		else
		{
			$var = (string) $smcFunc['htmltrim']($smcFunc['htmlspecialchars']($var), ENT_QUOTES);

			if (ctype_digit($var))
				$var = (int) $var;

			if (empty($var))
				$var = false;
		}

		return $var;
	}
266656
public function header(array $var = null)
    {
        $content = $this->content();

        if ($var !== null) {
            $content['header'] = $var;
            $this->content($content);
        }

        return $content['header'];
    }
1038850
public function toUpperCaseFirst($var)
    {
        $v = '' . $var;
        $len = $this->strlen($var);
        if (!$len) {
            return '';
        }
        if (static::$nativeSupport['mbstring']) {
            if ($len > 1) {
                return mb_strtoupper(mb_substr($v, 0, 1)) . mb_substr($v, 1);
            }
            return mb_strtoupper($v);
        }
        return $v;
    }
912202
public function getHtml($variable, $default = '', $allowed = "", $escape = true)
    {
        return (string) rawurldecode($this->get($variable, $default, $allowed, $escape));
    }
666722
public function markdown($var = null)
    {
        $content = $this->content();

        if ($var !== null) {
            $content['markdown'] = (string) $var;
            $this->content($content);
        }

        return $content['markdown'];
    }
748828
protected function varToString($var)
    {
        if (is_object($var)) {
            return get_class($var);
        }

        if (is_array($var)) {
            return 'Array';
        }

        if (is_resource($var)) {
            return sprintf('Resource(%s)', get_resource_type($var));
        }

        if (null === $var) {
            return 'null';
        }

        if (false === $var) {
            return 'false';
        }

        if (true === $var) {
            return 'true';
        }

        return (string) gettype($var);
    }
872967
public function getInferedType($variable)
    {
        if (isset($this->variables[$variable])) {
            $type = $this->variables[$variable];
            if ('variable' != $type && 'undefined' != $type && 'string' != $type && 'istring' != $type && 'array' != $type && 'null' != $type && 'numeric' != $type) {
                //echo $variable, ' ', $type, PHP_EOL;
                return $type;
            }
        }

        return false;
    }
646856
static function output($var)
	{
		if(!is_array($var)) self::warn('Error Debug!','Not is a array!');
		$attr['border'] = 1;
		$attr['style'] = 'font-size:14px';

		$table = new HTML_table($var, $attr);
		echo $table->html();
	}
1257837
public function get(string $var){
		$var = strtoupper($var);
		$env = null;

		if($this->global === true){

			if(array_key_exists($var, $_ENV)){
				$env = $_ENV[$var];
			}
			elseif(function_exists('getenv')){
				$env = getenv($var);
			}
			// @codeCoverageIgnoreStart
			elseif(function_exists('apache_getenv')){
				/** @noinspection PhpComposerExtensionStubsInspection */
				$env = apache_getenv($var);
			}
			// @codeCoverageIgnoreEnd

		}

		return $env ?? $this->_ENV[$var] ?? null;
	}
123510
public function raw($var = null)
    {
        $file = $this->file();

        if ($var) {
            // First update file object.
            if ($file) {
                $file->raw($var);
            }

            // Reset header and content.
            $this->modified = time();
            $this->id($this->modified() . md5($this->filePath()));
            $this->header = null;
            $this->content = null;
            $this->summary = null;
        }

        return $file ? $file->raw() : '';
    }