fork download
  1. <?php
  2.  
  3. $search = '/\^[^^]*\^/';
  4. $replace = "";
  5. $string = "^5561^18.5018,73.8636|^5662^20.1738,72.7640";
  6. echo preg_replace($search,$replace,$string);
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
18.5018,73.8636|20.1738,72.7640