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
https://forums.phpfreaks.com/topic/98013-ereg_replace-for-all-vars/
Share on other sites

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.