I am trying to make a function that removes everything before the second to last dot. If the string is something like www.dev.community.google.com then I want to remove everything before google.com.
These sub domains aren't always alike, sometimes they will just be www.google.com and sometimes www.community.google.com.
So the point is to remove everything before and including the second to last dot. How can I do this with php?