[英]How to add _ to white spaces in json objects?
我以這種方式加載json:
$json = file_get_contents("world_ita.json");
$data = json_decode($json, true);
但是文件包含“美國”或“不列顛群島”
我需要解析文檔,以便用下划線替換所有空格並使用它:
United_States or British_Islands
$output = str_replace(' ', '_', $input);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.