I have the following variable: $domain[domain] Which would equal something such as: thisismydomain.com I want it to strip/remove the period so it returns the following instead: thisismydomaincom Can someone help?
For some reason that's not working. Any other ways it can be done? EDIT: Actually, by changing ereg_replace to str_replace, it worked fine. Thanks, +rep!
I know you got it to work but let me tell you what you did wrong... "." means every possible character, so you (ereg_)replaced all the characters of the domain name to '' and got an empty string at the end. This could have worked but is not the best choise since str functions are faster than ereg ones: $dom = ereg_replace('\.', '', $domain[domain]); // see the backslach before the wildcart dot to cancel it special meening PHP: