Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Problem With ereg_replace


Message #1 by "Mark Carruth" <mcarruth@t...> on Mon, 11 Feb 2002 16:26:05 -0000
Also, granted it doesn't directly answer your question, but you could just
test to see if the first character is a "$" and just use substr() to chop it
off.

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Mark Carruth" <mcarruth@t...>
To: "professional php" <pro_php@p...>
Sent: Monday, February 11, 2002 11:26 AM
Subject: [pro_php] Problem With ereg_replace


> I simply want to turn the string $10 into simply 10. But obviously it
won't
> be 10 each time.
>
> The value of price is in the variable $price, so I use
>
> $price = ereg_replace("\$","",$price);
>
> To get rid of the $ at the front, but it doesn't work.
>
> Any ideas ?
>
> TIA
> Mark Carruth
>
>
>
>




  Return to Index