NYCPHP Meetup

[nycphp-talk] I need a function that will compare IP addresses

Rolan rolan at datawhorehouse.com
Mon Aug 18 13:19:35 EDT 2003


even better! :)

Daniel Kushner wrote:

>>or the ghetto way:
>>
>>function compareip($ipa,$ipb) {
>>    if (stristr(strrev($ipa),".")==stristr(strrev($ipb),"."))
>>{return true;}
>>    else {return false;}
>>}
>>    
>>
>
>In general, it is good practice to return the Boolean evaluation in such
>cases:
>
>function compareip($ipa,$ipb) {
>    return stristr(strrev($ipa),".")==stristr(strrev($ipb),".");
>}
>
>
>Best,
>Daniel Kushner
>
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>
>  
>




More information about the talk mailing list