fork download
  1. <?php
  2.  
  3. $remove_from_beginning = array( 'www.', 'wap.', 'admin.' );
  4. $final = "";
  5.  
  6. foreach( $remove_from_beginning as $start )
  7. {
  8. $final = $final . "" . substr_replace($start, '', -1) . "" . "\.|";
  9. }
  10.  
  11. $final = substr_replace($final, '', -1);
  12.  
  13. echo preg_replace("/" . "" . "(?:" . "" . $final . "" . ")" . "" . "(.*)" . "" . "/", "$1", "www.wap.com");
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
wap.com