@melbao wrote:
Hello,
i will extract rows from the database table visit_log via a shortened IPv6 from the Matomo backend.In the Visitor Logs displaying shortened IPv6: “2a02:810a:600:8800::”
In my PHP script: “0.0.0.0”
function binaryToStringIP($ip) ... (from piwik/vendor/piwik/network/src/IPUtils.php) SELECT inet_ntoa(conv(hex(location_ip), 16, 10)) as visitorIP FROM log_visit ... ... while ... ... echo binaryToStringIP($log_visit_row["visitorIP"]) // 0.0.0.0 echo bin2hex($log_visit_row["visitorIP"]) // (nothing) echo $log_visit_row["visitorIP"] // (nothing)
With IPv4 (echo bin2hex(…)) there is no Problem.
Posts: 2
Participants: 1