Re: strip out wierd characters in a string
| From: | Brent Clements | Date: | Mon, 18 Oct 2004 06:42:47 +0000 |
| Subject: | Re: strip out wierd characters in a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-199702@lists.php.net to get a copy of this message | ||
Solved my own problem.
I ran the script itself from the unix prompt and forced it's output to a
text file
I then viewed the text file and saw the actual wierd character. I then used
strtr to replace the wierd character with a single space.
Pretty simple and clean way to fix this.
-Brent
----- Original Message -----
From: "Brent Clements" <bclem@imaginative-enterprises.com>
To: <php-general@lists.php.net>
Sent: Monday, October 18, 2004 1:22 AM
Subject: [PHP] strip out wierd characters in a string
Hi Guys,
I think that a string that I'm grabbing from a website was actually created
using ms-word. If I echo the string out, it has a question mark in it.
If you look at the website, the text is fine
ie"string some more text"
but when I grab it from the website, and then echo the string, I get.
"string? some more text"
I have tried doing this
echo str_replace("?", " ", $text);
but it still print's out the ?. I think it's because the string itself has a
wierd binary character in it or something.
Anyone know how to fix this?
Thanks,
Brent