素朴な疑問かもしれませんが、次のような変数をどのようにとり、配列にしたらよいのでしょうか。
$hot = "It","is","hot","outside";
以下を実行しても機能しません。
$newhot = array($hot);
私は実際に次のような API を呼び出しています。
[["P0010001","NAME","state","zip code tabulation area"],
["68191","ZCTA5 99301","53","99301"]]
必要なのは、2 行目の人口です (最初の引用符)。
次を実行すると、「68191」、「ZCTA5 99301」、「53」、「99301」が得られます
$splitContent = implode("\n",array_slice(explode("\n",$populate),1,2));
$newContent = str_replace(']','',$splitContent);
$newContent = str_replace('[','',$newContent);