hi,
try this:
$string = "(100.00)";
$r1 = array("(",")");
$r2 = array("-","");
$rep = str_replace($r1, $r2, $string);
/* if you want to turn this, which is a string right now, into a float or an int, note that this will turn it from -100.00 to -100 */
$int = (int) $rep;
/* and just to test that out */
echo "<br />\n".gettype($int);
Originally posted by fnbcprog
Alright....What I am trying to do is remove the parenthesis from around a string value and substitute a negative sign in front of the number.
What is the best way to remove the parenthesis if you are given this value??
i.e. =>
Starting string (100.00)
Ending string -100.00
Thanks for your help!!!