You are here:  » Need to strip "$" from the returned record


Need to strip "$" from the returned record

Submitted by marlin on Wed, 2006-11-15 13:59 in

Hello,

Mostly up and running already with MP. I do have a slight problem that you might know a quick fix. Some of my numerica data is prefixed with a "$" sign. I tried to trim them out but I broke what I had. I am uploading a CSV file for parsing.

marlin

Submitted by support on Wed, 2006-11-15 15:42

Hello marlin;

If the $ sign is always the first character you could use substr() as follows:

$value = substr($value,1);

That would return everything after the 1st character, effectively stripping the $ sign. Another alternative is str_replace(), for example:

$value = str_replace("$","",$value);

Hope this helps,
Cheers,
David.