Quantcast
Channel: Why is PHP Treating Carriage Return / Linefeed Combo as a Single Byte? - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by TeAmEr for Why is PHP Treating Carriage Return / Linefeed Combo as...

convert the combo \r\n to \n , do whatever u need , then revert all \n's to the combo ...str_replace("\r\n","\n",$value);if (strlen($value) > 41) { $value = substr($value, 0,...

View Article



Why is PHP Treating Carriage Return / Linefeed Combo as a Single Byte?

I have a php script that truncates a string at 41 bytes. I call strlen on the string to check its size. However, if the string has a "\r\n" combo, this combo is treated as one byte. So in my case...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>