downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<inet_ntopip2long>
Last updated: Thu, 26 Jun 2008

inet_pton

(PHP 5 >= 5.1.0)

inet_pton — Converts a human readable IP address to its packed in_addr representation

Description

string inet_pton ( string $address )

This function converts a human readable IPv4 or IPv6 address (if PHP was built with IPv6 support enabled) into an address family appropriate 32bit or 128bit binary structure.

Parameters

address

A human readable IPv4 or IPv6 address.

Return Values

Returns the in_addr representation of the given address

Examples

Example #1 inet_pton() Example

<?php
 $in_addr
= inet_pton('127.0.0.1');
 
 
$in6_addr = inet_pton('::1');
 
 
?>

Notes

ChangeLog

Version Description
5.3.0 This function is now available on Windows platforms



add a noteadd a note User Contributed Notes
Converts a human readable IP address to its packed in_addr representation
There are no user contributed notes for this page.




<inet_ntopip2long>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs