Actions

API16

JLDAP/ipToNetAddress

< API16:JLDAP

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Converts a dot notation IP address to net address (e.g. for Netware, etc)


<! removed transcluded page call, red link never existed >

Syntax

ipToNetAddress($ip)
Parameter Name Default Value Description
$ip IP Address (e.g. xxx.xxx.xxx.xxx)

Returns

string Net address public

Defined in

libraries/joomla/client/ldap.php

Importing

jimport( 'joomla.client.ldap' );

Source Body

function ipToNetAddress($ip)
{
        $parts = explode('.', $ip);
        $address = '1#';
 
        foreach ($parts as $int) {
                $tmp = dechex($int);
                if (strlen($tmp) != 2) {
                        $tmp = '0' . $tmp;
                }
                $address .= '\\' . $tmp;
        }
        return $address;
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples


Advertisement