Page 1 of 1

take out a character

Posted: Fri May 13, 2005 2:45 pm
by Skara
just curious. don't really need to use it.

But say I have a date that looks like this:
13052005
and if the third character is a 0, take it out (and add -s)
so it would be:
13-5-2005

My question is, is there a function to delete a character? Or could you only use two substr()s?

Posted: Fri May 13, 2005 5:24 pm
by Ambush Commander
substr_replace

or

$var{$character_number} = '-';