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.
print_r($arraydata);
出力を取得しました
配列([0] => vikas[1]=>シャツ[2]=>cloth1[3]=>テスト[4]=>シャツ[5]=>cloth2[6] => avi)
私はそのような配列を表示する必要があります
$ arr = array( "vikas"、 "shirt"、 "cloth1"、 "test"、 "shirt"、 "cloth2"、 "avi");
これを使って :
echo '$arr = array("'.implode('", "', $arraydata).'");';
カンマ区切りが必要な場合:
echo '$arr = array('; foreach ($array as $key => $value) { if ($key > 0) echo ','; echo '"'.$value.'"'; } echo ');';