PDA

View Full Version : String Replace


ptmuldoon
02-06-2008, 04:42 PM
I'm pulling data out of a table, and using one of those fields in my css as id={field_name}

The field name includes names with a character space in them, ie

New York
San Francisco

All of the data in the query is currently used in an array. Is there a way to do a string replace to remove the character space, or maybe replace the space wit an underscore?

EDIT:

Nevermind. I was able to do it outside the query in loop. using str_replace()

angst
02-06-2008, 06:00 PM
hey, don't give up so fast;)

mysql has it's own Replace() function:
http://www.nikmakris.com/2005/mar/29.html