fork download
  1. <?php
  2.  
  3. $str = '[{lat: "[{"area":"-22.88975203013098", lng: "-43.12695211119432,"},…] 0 : {lat: "[{"area":"-22.88975203013098", lng: "-43.12695211119432,"} 1 : {lat: "-22.88977179811704", lng: "-43.12685018725176,"} 2 : {lat: "-22.88979650809557", lng: "-43.126624881694504,"} 3 : {lat: "-22.890513095516", lng: "-43.12649077124376,"} 4 : {lat: "-22.89054274732773", lng: "-43.126807271907516,"} 5 : {lat: "-22.88975203013098", lng: "-43.12695211119432"}]"}';
  4.  
  5. $pattern = '/\"\[{"area":"/s';
  6. $str = preg_replace($pattern, " ", $str);
  7.  
  8. echo $str;
  9.  
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
[{lat:  -22.88975203013098", lng: "-43.12695211119432,"},…] 0 : {lat:  -22.88975203013098", lng: "-43.12695211119432,"} 1 : {lat: "-22.88977179811704", lng: "-43.12685018725176,"} 2 : {lat: "-22.88979650809557", lng: "-43.126624881694504,"} 3 : {lat: "-22.890513095516", lng: "-43.12649077124376,"} 4 : {lat: "-22.89054274732773", lng: "-43.126807271907516,"} 5 : {lat: "-22.88975203013098", lng: "-43.12695211119432"}]"}