I'd like to know if there is a way to convert commas and periods in a variable to a blank space or to just erase them. Example: for the variable:
$text = linux, openserver, VPN. ;
i'd like to convert it to:
$text = linux openserver VPN ;
I'd really appreciate it.
Consider [man]str_replace[/man], [man]preg_replace[/man], or even [man]strtr/man.
Most likely str_replace() will do.
thanx but i could use an example, if you don't mind.
$text = "linux, openserver, VPN." $text = str_replace(',', '', $text); $text = str_replace('.', '', $text); echo $text;
$text = "linux, openserver, VPN." $text = preg_replace('/[\\.\\,]/', '', $text); echo $text;
thanx a lot, man. I really appreciate it.