Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
助けが必要です.csvファイルにこの種のアドレスがあり、別の方法でフォーマットする正規表現が必要です.試してみましたが、正規表現は実用的ではありません.
それが元の住所です
10, Via della Libertà - 90100 パレルモ (PA)
そして、私はこのようにそれを必要としています
Via della Libertà, 10, 90100 パレルモ (PA)
私に何ができる?私はphpでそれをしなければなりません
$strあなたのcsvコンテンツです
$str
$str = preg_replace_callback('/(\d+),\s([^\-]+)\-/', function($matches){ return trim($matches[2]).', '.$matches[1].', '; }, $str);