3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? $ipi = getenv("REMOTE_ADDR"); function encode_ip($ipi) { // First thing to do, split the IP into its quads $ip = explode('.', $ipi); // Now we convert it and return it to the caller for (i=0; i < count($ip); i++) { $ip[i] = dechex($ip[i]); } //join the parts together $IP_ADD = join(".",$ip); } echo $ip; ?>
Output for 5.3.0 - 5.4.32
<? $ipi = getenv("REMOTE_ADDR"); function encode_ip($ipi) { // First thing to do, split the IP into its quads $ip = explode('.', $ipi); // Now we convert it and return it to the caller for (i=0; i < count($ip); i++) { $ip[i] = dechex($ip[i]); } //join the parts together $IP_ADD = join(".",$ip); } echo $ip; ?>