Ejemplo n.º 1
0
function change($text)
{
    $text = nv_unhtmlspecialchars(trim(nv_convert(strip_tags($text))));
    $text = str_replace(array('"', '>', '<', '´', '`'), array('&quot;', '&gt;', '&lt;', '&#180;', '&#96;'), $text);
    //if($strip==1)
    //{
    //$text = strip_tags($text);
    //}
    return $text;
}
Ejemplo n.º 2
0
                     for ($i = 0; $i < count($arr); $i++) {
                         if (preg_match("/{([^*]+)}/", $arr[$i], $matches)) {
                             // Nếu mẫu đối tượng cần xóa có dạng {nth} thì xóa đối tượng con có thứ tự là nth
                             $element->children($matches[1])->outertext = '';
                         } else {
                             foreach ($element->find($arr[$i]) as $e) {
                                 $e->outertext = '';
                             }
                         }
                     }
                 }
                 // Thông tin lấy được
                 if ($value['field_name'] == 'bodyhtml') {
                     $item[$value['field_name']] = stripwhitespace(nv_convert($element->innertext));
                 } else {
                     $item[$value['field_name']] = stripwhitespace(nv_convert(strip_tags($element->innertext)));
                 }
                 break;
             }
         }
     }
     // Xóa chuỗi ký tự đã khai báo
     if ($string_delete = $value['string_delete']) {
         $arr_string_delete = explode(',', $string_delete);
         for ($s = 0; $s < count($arr_string_delete); $s++) {
             $item[$value['field_name']] = str_replace($arr_string_delete[$s], '', $item[$value['field_name']]);
         }
     }
 }
 //debug($item);
 if (isset($item['title']) and $item['title']) {