wow, talk about digging up a 4 year old post!
anyhow, your example is wrong. your "if" statement would pass regardless of where the location of the partial IP is. strstr just returns the string up until the position of the match.
example: 1.2.3.58, 1.2.74.171
both of those IPs would be denied access. you need to use regular expressions to indicate that '58' is the beginning of what you are trying to match.