rev_rance wrote in php

Strip a period at the end of a line...

Greetings... Semi-novie with PHP here. Toyed with it years ago, and just started working on a project that is based in PHP. I'm getting some information from a MySQL database, and I've used str_replace to modify most of what I need, but I'm pulling a domain name from a sentence, so what string_replace leaves me with is 'domain.name.com.'

I'm trying to get rid of the trailing period, and I've tried using:

$text="domain.name.com.";

$newtext=rtrim($text, '.');

The . does not go away. I've tried with double quotes as well.

Any help would be most graciously appreciated!




EDIT: Got it... thanks for all your help!