fork(1) download
  1. <?php
  2.  
  3. echo masked_ip( '192.168.0.1' ) . PHP_EOL;
  4. echo masked_ip( '192.168.10.31' ) . PHP_EOL;
  5. echo masked_ip( '192.168.12.132' ) . PHP_EOL;
  6.  
  7. function masked_ip( $ip ) {
  8. return substr( $ip, 0, strrpos( $ip, '.' ) - 1 ).'*.***';
  9. }
  10.  
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
192.168.*.***
192.168.1*.***
192.168.1*.***