|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-12-06 07:28 UTC] mike@php.net
-Status: Open
+Status: Not a bug
[2013-12-06 07:28 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 03:00:01 2025 UTC |
Description: ------------ No matter how many ways CRLF (\r\n) has been tried to be replaced in a PHP script by <BR>, it does not produce a consistent result. This happens especially when trying to parse returned whois information. The $info in the following script will work with some parsing of the whois info with a string replacement of a CRLF (\r\n) on one domain (registrar) and yet on a different domain it will not work at all. I have looked at the differing outputs (depending on domain name) with a HEX editor and I know for a fact that there is a replacement problem with CRLF and php. I have tried A LOT of various scripts from people having the same problem, with no further success. The replacement of \r\n should be straight forward as in other languages but it is not in php. Perhaps a special function should be made for the task of replacemet of CRLF with another character. Have a look at the code below. Try different domain names and notice how the CRLF is parsed (with your own code to parse $info) on some domain information it will work and yet other domains it will not parse the CRLF (HEX-ODOA)! This is an ongoing problem for other people as well. Test script: --------------- <?php require_once "Net/Whois.php"; $whois = new Net_Whois(); /* You can add other NIC server as a second parameter. */ $info = $whois->query('example.com'); echo($info); ?> Expected result: ---------------- Please fix this string replacement problem _PLEASE.