Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

SimplePie A PHP-Based RSS and Atom Feed Framework. Takes the hard work out of managing a complete RSS/Atom solution.

Author: Ryan Parman
Author: Sam Sneddon
Author: Ryan McCue
Copyright: 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
License: http://www.opensource.org/licenses/bsd-license.php BSD License
File Size: 271 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

SimplePie_Net_IPv6:: (5 methods):
  uncompress()
  compress()
  split_v6_v4()
  check_ipv6()
  checkIPv6()


Class: SimplePie_Net_IPv6  - X-Ref

Class to validate and to work with IPv6 addresses.

uncompress($ip)   X-Ref
Uncompresses an IPv6 address

RFC 4291 allows you to compress concecutive zero pieces in an address to
'::'. This method expects a valid IPv6 address and expands the '::' to
the required number of zero pieces.

Example:  FF01::101   ->  FF01:0:0:0:0:0:0:101
::1         ->  0:0:0:0:0:0:0:1

param: string $ip An IPv6 address
author: Alexander Merz <alexander.merz@web.de>
author: elfrink at introweb dot nl
author: Josh Peck <jmp at joshpeck dot org>
return: string The uncompressed IPv6 address

compress($ip)   X-Ref
Compresses an IPv6 address

RFC 4291 allows you to compress concecutive zero pieces in an address to
'::'. This method expects a valid IPv6 address and compresses consecutive
zero pieces to '::'.

Example:  FF01:0:0:0:0:0:0:101   ->  FF01::101
0:0:0:0:0:0:0:1        ->  ::1

param: string $ip An IPv6 address
return: string The compressed IPv6 address

split_v6_v4($ip)   X-Ref
Splits an IPv6 address into the IPv6 and IPv4 representation parts

RFC 4291 allows you to represent the last two parts of an IPv6 address
using the standard IPv4 representation

Example:  0:0:0:0:0:0:13.1.68.3
0:0:0:0:0:FFFF:129.144.52.38

param: string $ip An IPv6 address
return: array [0] contains the IPv6 represented part, and [1] the IPv4 represented part

check_ipv6($ip)   X-Ref
Checks an IPv6 address

Checks if the given IP is a valid IPv6 address

param: string $ip An IPv6 address
return: bool true if $ip is a valid IPv6 address

checkIPv6($ip)   X-Ref
Checks if the given IP is a valid IPv6 address

param: string $ip An IPv6 address
return: bool true if $ip is a valid IPv6 address