Tag Archives: extract domain php

Extracting a domain name with PHP and Regular Expressions

As most of your know, regular expressions can be a nightmare if you don’t know much about the subject. Here is a quick tutorial on how you can extract the domain name from any URL using regular expressions and PHP. This includes http:// and https:// domain names.   <?php $link1 = "http://nickduncan.co.za/"; $link2 = "http://nickduncan.co.za"; [...]

Continue Reading