Jump to content

str_replace problem


c_pattle

Recommended Posts

When getting data from a database I'm trying to use the str_replace function to get rid of any pound signs but it doesn't seem to be working.  My code is below. 

 

str_replace("£", "", $array['product_price'])

 

I've also tried replace "£" with "£" but that doesn't work either.  Does anyone know why that's happening?

 

Thanks for any help. 

 

 

Link to comment
Share on other sites

I checked and it is stored in the same field.  Also if I try to use the same code on a post variable so that I remove the "£" before it gets entered into the database it still doesn't seem to remove it.  So if I did the following it doesn't work. 

 

$products->product_price = str_replace("£", "", $_POST['product-price']);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.