How to format a strign with a generic mask??
| From: | Felipe Desiderati | Date: | Thu, 12 Jun 2003 00:23:32 +0000 |
| Subject: | How to format a strign with a generic mask?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151171@lists.php.net to get a copy of this message | ||
Hi Folks,
First of all, sorry for my english, but it isn´t good. I ´ll try to be cleary. Weel, I need a
simple function that takes a string and format with a generic mask. Like this example above:
$string1 = "12345678"
$string2 = "11062003"
echo format_string ("#.###.###-#", $string1); // --> Returns 1.234.567-8
echo format_string ("##/##/####", $string1); // --> Returns 11/06/2003
Does anybody here have an idea to how to do this?
Thanks, and sorry again for my english.
__________________________________________________________________
Felipe Desiderati e Souza
Analista de Sistemas e Suporte
Unimed - Fed. Est. Rio de Janeiro
ICQ#: 68557248
__________________________________________________________________