I have XML file and my Requirement is to make manual real Carriage Return after 76 chars Into DigestValue node element of that XML file using PHP
By doing that i can validate my XML with per-defined structure of system validator. I am doing that using following line into PHP code.
$digest = wordwrap($digest, 76, "\r\n", true);
However I am getting & #13; which is not proper and I am not able to validate XML file.
I am looking for solution to make manual Carriage Return using PHP but without & #13; into XML string.
So far I have tested following variations.
$digest = wordwrap($digest, 76, "
", true); // <-- NEW LINE IS WORKING '0A' LF But no Carriage Return HAX Value
$digest = wordwrap($digest, 76, " ", true);
$digest = wordwrap($digest, 76, "\r", true); // Gives --> IVkHH9IGqaDDHt iGfODKPJmg==
$digest = wordwrap($digest, 76, "\r\n", true);
$digest = wordwrap($digest, 76, "
", true);
$digest = wordwrap($digest, 76, "
", true);
$digest = wordwrap($digest, 76, PHP_EOL, true);
$digest = wordwrap($digest, 76, "<![CDATA[\r\n]]>", true);
$digest = wordwrap($digest, 76, "\r
", true);
$digest = str_replace(' ','',$digest);
$digest = str_replace('&\\#13;','',$digest);
$digest = str_replace('\x13','',$digest);
Following are some screen shots which might be helpful.
WRONG HEX Viewer
WRONG XML File OUTPUT
CORRECT HEX VALUE
CORRECT XML File OUTPUT
I want suggestion OR PHP solution OR any other way to achieve this. I have tested this script into Windows and Linux, So i think its not OS dependent issue.
Issue Summery : I want to add "Carriage Return" manually to XML string.