...

View Full Version : Getting rid of + and -



ole90
07-31-2007, 03:57 PM
I can't seem to get rid of +s and -s from my strings. Sometimes users input + and -s into there points to make themselves have more points.

I've tried:

intval($variable);
if ( !ereg("[0-9]+$",$variable)) {

but it can't seem to get it to work. Any help?

devinemke
07-31-2007, 04:31 PM
$strings = array('+','-');
$variable = str_replace($strings, '', $variable);

ole90
07-31-2007, 05:12 PM
Thank you :D!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum