[PHP] str_replace to ignore commas

2004-01-06 Thread Vernon
I'm trying to use str_replace to ignore sertain characters from a recordset field and it seems I am having difficulties with ignoring commas and carriage returns. I've gotten the following but when searching for, let's say, New York. When York is at the end of a sentence from a recordset field it

Re: [PHP] str_replace to ignore commas

2004-01-06 Thread Chris Hayes
At 15:29 6-1-04, you wrote: I'm trying to use str_replace to ignore sertain characters from a recordset field and it seems I am having difficulties with ignoring commas and carriage returns. I've gotten the following but when searching for, let's say, New York. When York is at the end of a

Re: [PHP] str_replace to ignore commas

2004-01-06 Thread Vernon
could the problem be that you explode on so the phrase 'New York', having a space, is split up? Could be. Some times the New is on one line and the York is on the next line. I need for it to explode no matter what. How would I do that? For instance the print_r for the array shows me this in

Re: [PHP] str_replace to ignore commas

2004-01-06 Thread Chris Hayes
At 15:58 6-1-04, you wrote: could the problem be that you explode on so the phrase 'New York', having a space, is split up? Could be. Some times the New is on one line and the York is on the next line. I need for it to explode no matter what. How would I do that? For instance the print_r for

Re: [PHP] str_replace to ignore commas

2004-01-06 Thread Richard Davey
Hello Vernon, Tuesday, January 6, 2004, 2:29:31 PM, you wrote: V I'm trying to use str_replace to ignore sertain characters from a recordset V field and it seems I am having difficulties with ignoring commas and V carriage returns. I've gotten the following but when searching for, let's Nowhere

Re: [PHP] str_replace to ignore commas

2004-01-06 Thread Vernon
Nowhere in your replacement array do you check for, or remove, carriage returns. Add this \n to it: $replacement = array(\, \,, ., !, ?, \n); Your exploded array should now be correct. When I do this I get some really unexpected results. Almost everything comes up bold. -- PHP General

Re[2]: [PHP] str_replace to ignore commas

2004-01-06 Thread Richard Davey
Hello Vernon, Tuesday, January 6, 2004, 3:56:18 PM, you wrote: Nowhere in your replacement array do you check for, or remove, carriage returns. Add this \n to it: $replacement = array(\, \,, ., !, ?, \n); Your exploded array should now be correct. V When I do this I get some really