Simple PHP question

Status
Not open for further replies.

nogenius

likes money
Mar 16, 2007
487
3
0
Texas
Hi,

I am making a dynamic web site from a database. The database contains a field that has the html special character #233; (which converts to an e with an accent on it).

I'm generating URLs out of the field, and would like to strip the #233; character out and replace it with an empty space. I've tried various functions to do this, including strtr() and str_replace(), and they seem to have no effect.

Can anyone suggest a function that would be appropriate for this problem?
 


Just use a regular expression. I don't know if there is a premade function to do it or not, but it shouldn't matter if you are only doing it once. Here's some untested code for you.

Code:
preg_replace("/\#(.*?);/", ' ', $var);
 
Status
Not open for further replies.