Jump to content

chr function not working in PHP 4.3.2???


harley1387

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.