Jump to content

[SOLVED] problems with preg_replace function


riceje7

Recommended Posts

i'm trying to strip out all punctuation from a string but it doesn't seem to work right. the function is just outputing the same text that is input. here is my code any help would be great. thanks

 

<?php 
function parsetext($text){
		rtrim($text);
		preg_replace("/[^a-zA-Z0-9 ]/",'',$text);
		strtolower($text);
		echo $text;
}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.