Sorry if this is too small to be suitable as a stack overflow issue, but I'm a little used to regular expressions.
My question is: what is a regular expression that returns the string “token” for all the examples below?
- token.domain.com
- token.domain.com/
- token.domain.com/index.php
- token.domain.com/folder/index.php
- token.domain.com/folder/subfolder
- token.domain.com/folder/subfolder/index.php
- (added after editing)
- domain.com
- domain.com/
I am trying to use the preg_replace function inside to find out the subdomain of the current page from the variable $ _SERVER ['SERVER_NAME'].
Thanks in advance, Titel
: sebnow, , , , , - - , NULL