- var_dump: documentation ( source)
- bin2hex: documentation ( source)
- str_replace: documentation ( source)
<?php
$code = "-\r-\r\n-\n-";
$hex = bin2hex($code);
var_dump($hex);
$code1 = str_replace("\r\n", "\n", $code);
$hex = bin2hex($code1);
var_dump($hex);
$code2 = str_replace(array("\r\n", "\r"), "\n", $code);
$hex = bin2hex($code2);
var_dump($hex);