Jump to content

Recommended Posts

I'm currently testing an identical file on two servers:

 

Server A: PHP 5.1.4

Server B: PHP 4.3.2

 

For whatever reason, chr only works on Server A. In Server B, it returns the following character for every value in the array below: �

 

$chars = array(

128 => '€',

130 => '‚',

131 => 'ƒ',

132 => '„',

133 => '…',

134 => '†',

135 => '‡',

136 => 'ˆ',

137 => '‰',

138 => 'Š',

139 => '‹',

140 => 'Œ',

142 => 'Ž',

145 => '‘',

146 => '’',

147 => '“',

148 => '”',

149 => '•',

150 => '–',

151 => '—',

152 => '˜',

153 => '™',

154 => 'š',

155 => '›',

156 => 'œ',

158 => 'ž',

159 => 'Ÿ'

);

 

The PHP manual says that chr works in PHP 4, PHP 5. Any ideas what may causing the problem? Server config?

 

Any help would be greatly appreciated...

Link to comment
https://forums.phpfreaks.com/topic/86296-chr-function-not-working-in-php-432/
Share on other sites

Thanks for the info. I just ran a quick test and sure enough it works for chars below 127 in PHP 4.3.2 on an Apache server. I'm running PHP 5.1.4 locally on my Mac so I'm not sure if that's why the extra characters are supported?

 

Either way, do you have a good workaround for accessing ASCII characters in the 128 - 159 range? I'm trying to replace all the crap MS Word dumps in on a copy/paste to textarea field.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.