unique bookmark

Hello ..

I am trying to match existing URL in my site to be cross checked before posting if there is an existing URL the website stops the user from posting the plugin is working for certain URL say ..
http://google.com , https://google.com (It recognize for these type of URL )

but it does not recognize these..

http://www.google.com , https://www.google.com

For ur reference :

if($address){
if(!preg_match("#^((ht|f)tps?:)?//|www.#i",$address)) {             //if(!preg_match("#^((ht|f)tps?:)?//#i", $address))
$address = "http://www.$address" ;         //$address = "http://$address"
}
$address = rtrim($address, '/');
$entities = elgg_get_entities_from_metadata(array( 'type' => 'object', 'subtype' => 'bookmarks', 'metadata_name' => 'address', 'metadata_value' => $address, 'limit' => 1));
 
can anyone plz tell me what i am actually missing for these type of URL as well (http://www.google.com , https://www.google.com)

 

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.