Advertisement
Guest User

Untitled

a guest
Mar 8th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onurl( $urllist = array(), $url = '' ) {
  2.  
  3.     $urllist = array_map( 'trim', $urllist );
  4.  
  5.     if(!empty($urllist)) {
  6.         foreach( $urllist as $ul ) {
  7.             if(preg_match( '#' . $ul . '#i', $url )) {
  8.                 return true;
  9.             }
  10.         }
  11.         // if we are here then there hasn't been a match
  12.         return false;
  13.     } else {
  14.         return true;
  15.     }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement