<?php
$ip='192.168.0.1';
$e=explode('.',$ip);//split on the dot
echo $e[0].'.'.$e[1]; //glue back the first 2 pieces
PD9waHAKCiRpcD0nMTkyLjE2OC4wLjEnOwoKJGU9ZXhwbG9kZSgnLicsJGlwKTsvL3NwbGl0IG9uIHRoZSBkb3QKCmVjaG8gJGVbMF0uJy4nLiRlWzFdOyAvL2dsdWUgYmFjayB0aGUgZmlyc3QgMiBwaWVjZXM=