Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

preg_replace()

Status
Not open for further replies.

vbkris

Programmer
Joined
Jan 20, 2003
Messages
5,994
Location
IN
i have a string like this(CSV file)
"ASD,asd",asd,asd

i want to replace all the , within double quotes to ##, ie it must become:
"ASD##asd",asd,asd

i wrote a regex for it:
$line=preg_replace("/\"(.*)\"/U","\"str_replace(',','##','\\1')\"",$line);

why is str_replace not working?



Known is handfull, Unknown is worldfull
 
got it fellows... its the /e modifier...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top