Jump to content

Match & Remove part of string


shaggycap

Recommended Posts

I need to remove everything up to and inlcuding the -, ie the following string

15e-6812

needs to be converted to 6812.

[code]$string  = '15e-6812';

preg_replace($reg_expression_goes_here, '', $string);[/code]

And the number of characters before the minus sign varies, so is it possible to match 'to the left of and including' the minus sign?

Thanks.
Link to comment
https://forums.phpfreaks.com/topic/31346-match-remove-part-of-string/
Share on other sites

  • 3 weeks later...

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.