A simple question in PHP but need help
To percent 开发者_如何学JAVAencode a input string (an XML file), only for % and line terminators..
Don't roll your own URL encoding. Use the built-in stuff.
$xml = urlencode($xml);
If I understood your question correctly, you'll need to do something like
$input .= 'datacenter: ' . str_replace(array('\n', '\r'), array('%0A', '%0D'), $xmlfile) . "\n";
精彩评论