fork(6) download
  1. <?php
  2.  
  3. $re = '/^\h+|\h+$|(\R){2,}|(\s){2,}/m';
  4. $flightinfo = ' 1 . BritishAirways 15FEB LONDON HONGKONG
  5.  
  6.  
  7. 2 . CathayPacific 01MAR HONGKONG SHANGHAI
  8.  
  9.  
  10.  
  11. 3 . Qantas 12MAR SINGAPORE SYDNEY';
  12. $flightinfo = preg_replace($re, '$1$2', $flightinfo);
  13. echo $flightinfo;
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
1 . BritishAirways 15FEB LONDON HONGKONG
2 . CathayPacific 01MAR HONGKONG SHANGHAI
3 . Qantas 12MAR SINGAPORE SYDNEY