Jump to content

ereg_replace for all vars


jmurch

Recommended Posts

 

 

I have a need to do a ereg_replace on a bunch of strings as I am uploading a csv and the vendor can never have a single quote and has no escape character for them. So, I have a page with 20 os so variable that come from a form and go into a DB just fine but I need to reprocess them to creat the CSV for the vendor. 

 

Question 1: Is there a standard way of processing all of the vars through an array and dump each one out with a modified name after it is processed?

 

Question 2: What is the proper syntax to escape the escape so it can be replaced.

 

This only replaces the ' it doesn't replace the \ so when my input is \' my output is \`. It is supposed to be '  .

 

$location_address_1 = ereg_replace("\'","`",$physical_location_address);

 

TIA, Jeff

 

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.