Jyxo\Html::is PHP Method

is() public static method

It is just an estimation.
public static is ( string $text ) : boolean
$text string Input text to be tested
return boolean
    public static function is(string $text) : bool
    {
        return (bool) preg_match('~<[a-z][a-z0-9]*(\\s[^<]*)?>~i', $text);
    }

Usage Example

Beispiel #1
0
Datei: Body.php Projekt: jyxo/php
 /**
  * Returns if the contents is in HTML format.
  *
  * @return boolean
  */
 public function isHtml() : bool
 {
     return \Jyxo\Html::is($this->main);
 }