Re: Formatting an ascii characters in php?
| From: | Curt Zirzow | Date: | Fri, 08 Aug 2003 21:30:21 +0000 |
| Subject: | Re: Formatting an ascii characters in php? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158953@lists.php.net to get a copy of this message | ||
* Thus wrote Scott Fletcher (scott@abcoa.com):
> Hi!
>
> I use the cURL to send and receive data regardless of what data format
> is the data in. There are certian ascii characters in the data, like 'LF'
> for line feed, 'CR' for carriage return, etc. This time I came upon a
> problem where one of those ascii character caused PHP to get tripped up.
> So, is there any PHP function or script that can translate the ascii
> character into a text format where I can read each of those character to see
> which one is causing the problem so I can be able to fix the problem. Any
> know of any of such PHP feature that can do those conversion?
You can read each char by walking through it like:
for ($i = 0; $i < strlen($str); $i++) {
print ord($str[$i]);
}
that will print the ordinal value the characters in the string.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."