Regular expression special filter

/ * * [Upload special filter emoticon] 
 * @param STR $ 
 * Mixed @return 
 * / 
function filter_emoji ( $ STR ) 
{ 
    $ STR = the preg_replace_callback (     // perform a regular expression search and replace using a callback 
        '/ ./u ', function ( Array $ match ) {
             return strlen ( $ match [0])> =. 4?' ': $ match [0 ]; 
        } ,
         $ STR ); return $ STR ; 
}
          

     

 

Guess you like

Origin www.cnblogs.com/zwtqf/p/11305936.html