Jump to content

filter for domain and toplevel domain


WesleyA

Recommended Posts

There is an issue I have with creating a filter for the correct domain and toplevel domain. For example google.com is correct and all the other not.

 

my code:

     function my_funct($data2) {        $data2 = preg_replace('#(http://www.|http:|https:|ftp://www.|https://www./|//|www.|htp:|htt:|htp:/|htt:/|)#  ' , '', $data2);         return $data2;         }

but directories wil not be blocked

 

like www.google.com/directory/page/page2

 

is there a way to use preg_replace and put only domain and toplevel domain in it?

 

maybe it is possible to negate it, but he entire validation of pre_replace would be changed I assume.

Edited by WesleyA
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...