Jump to content

preg_replace help needed for wildcard


Ansel_Tk1

Recommended Posts

Hi - I am way out of my league here. If you are willing to help I appreciate it. I will pay a little $ for your help as well - email me at [email protected] with how much and I will let you know. Here is the question:

 

I have strings like this in a field:

BASE;Price-$231;231.00

 

And I need the string returned with only the amount AFTER the LAST semi-colon. i.e:

231.00

 

Your help is GREATLY appreciated!

 

Link to comment
https://forums.phpfreaks.com/topic/130283-preg_replace-help-needed-for-wildcard/
Share on other sites

Yeah $string is just example of what you showed.  It doesn't matter what the price is.  Code explodes at the semicolons and grabs the last value in the exploded array, so assuming that the actual format of the string stays the same (semicolon followed by value), you should get what you need.

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.