Web and Technology Support
Html, JAVA,DOTNET,Javascript, PHP, and JQuery Scripts and its issues with solutions
Showing posts with label
ip
.
Show all posts
Showing posts with label
ip
.
Show all posts
Monday, 13 October 2014
How to convert integer from ip address using php? (ip2long)
$lower = "IP ADDRESS";
echo $lower_dec = (float)sprintf("%u",ip2long($lower));
Monday, 4 August 2014
How to determine if an ip within specific range or not by using php?
$lower = "0.0.0.0.0";
$upper = "255.255.255.255";
$ip = "0.0.0.10";
$lower_dec = (float)sprintf("%u",ip2long($lower));
$upper_dec = (float)sprintf("%u",ip2long($upper));
$ip_dec = (float)sprintf("%u",ip2long($ip));
if( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) ){
echo "True";
}else{
echo "False";
}
Older Posts
Home
Subscribe to:
Posts (Atom)