piterskiy

Защита от шлака при парсинге

Mar 18th, 2016
24,127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (substr_count($lines,"??")==0 && substr_count($lines,"�")==0)  { //  проверка на шлак в ключах
  2.  
  3. if (substr_count($lines,"??")<1 && substr_count($lines,"�")<1 && substr_count($lines,"http://")<1)  { //  проверка на шлак в ключах
  4.  
  5. preg_replace( '/[^\p{L}\p{Nd}\/0-9]+/u', '-', $string ) ; //http://habrahabr.ru/blogs/php/45910/
Add Comment
Please, Sign In to add comment