Beispiel #1
0
 /**
  * @covers Org\Snje\Minifw\Text::strip_tags
  */
 public function test_strip_tag()
 {
     $hash = ["<p>123</p>" => "123", "<br />123<br/>" => "123", "<p style=\"font-size:12px; color:red\">123</p>" => "123", "<p style=\"font-size:12px; color:red\" >123</p>" => "123", "<?ss style=\"font-size:12px; color:red\" >123</p>" => "<?ss style=\"font-size:12px; color:red\" >123"];
     foreach ($hash as $k => $v) {
         $this->assertEquals($v, FW\Text::strip_tags($k));
     }
 }
Beispiel #2
0
 /**
  * 保存字符串到文件,会对字符串内容进行压缩
  *
  * @param string $str 要保存的字符串
  * @param string $group 分组
  * @param string $ext 扩展名
  * @param string $fsencoding 文件系统的编码,如不为空则会自动进行一些编码转换
  * @return string 保存的相对路径
  */
 public static function save_str($str, $group, $ext, $fsencoding = '')
 {
     $str = Text::strip_html($str);
     return self::save($str, $group, $ext, $fsencoding);
 }