MemoryRefresh!

Network



Questions Answers 0%

Pages   0 from 51
Questions   0 from 84

Reset




<?php $ip = gethostbyname('www.example.com'); $long = ip2long($ip); if ($long == -1 || $long === FALSE) { echo 'Invalid IP, please try again'; } else { echo $ip; // 192.0.34.166 echo $long; // -1073732954 } * fsockopen() Open Internet or Unix domain socket connection. Use the fsockopen function to open a socket connection for communicating with a server whose protocol is not supported by PHP <?php fsockopen("www.example.com", 80, $errno, $errstr, 30); * socket_set_timeout() Set timeout period on a stream (alias of the stream_set_timeout) <?php stream_set_timeout($fp, 2); * getservbyname() Get port number associated with an Internet service and protocol -- int getservbyname ( string $service , string $protocol ) * ip2long() Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address
Questions

Related pages

File open !
Read file !
Read csv !
File contents !
File cache and stats !
File lock !
File parse !
Context !
Network !


0% 100%
 
 
0 pages 51 pages
1) Get ip by host




Last Review: n/a   Passed: n/a   Reviews: n/a   Next Review: n/a  



<?php $ip = gethostbyname('www.example.com'); $long = ip2long($ip); if ($long == -1 || $long === FALSE) { echo 'Invalid IP, please try again'; } else { echo $ip; // 192.0.34.166 echo $long; // -1073732954 } * fsockopen() Open Internet or Unix domain socket connection. Use the fsockopen function to open a socket connection for communicating with a server whose protocol is not supported by PHP <?php fsockopen("www.example.com", 80, $errno, $errstr, 30); * socket_set_timeout() Set timeout period on a stream (alias of the stream_set_timeout) <?php stream_set_timeout($fp, 2); * getservbyname() Get port number associated with an Internet service and protocol -- int getservbyname ( string $service , string $protocol ) * ip2long() Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address



More from Php

Basics
Variables
Operators
Function
Array
String
Streams
Uncategorized


More from Programming

Php
jQuery




Powered by minte9.com