Jump to content

Truncating alphabets and other characters from string


watsmyname

Recommended Posts

Hello,

 

Well i have var $string var, which might hold a string like this "$23.59 per pack", "$23.59/boxes","23.59 per vial" and so on and in any form. All i need to do is truncate all characters and leave only numeric value, i.e 23.59 only. All i could think is using array of those unwanted words and replace them with a blank space.

is there any way to do this task easily?

 

Thanks in advance

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.