API15

JLDAP/ipToNetAddress: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Converts a dot notation IP address to net address (e.g. for Netware, etc) <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JLDAP/ipT...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JLDAP/ipToNetAddress|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JLDAP/ipToNetAddress}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 49: Line 49:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JLDAP/ipToNetAddress|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JLDAP/ipToNetAddress}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=ipToNetAddress
  category=ipToNetAddress
  category=JLDAP
  category=JLDAP
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Latest revision as of 00:55, 25 March 2017

Description

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

[<! removed edit link to red link >]

<! 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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples