我有我打印成字符串:正則表達式:詞用空格到字符串數組
$string = "winter coats gloves hats blankets sleeping bags tarps milk magnesia shoes boots art";
,我需要正則表達式轉換成字符串數組,如:
$newString = array ('winter','coats','gloves','hats','blankets','sleeping','bags','tarps','milk','magnesia','shoes','boots','art');
的挑戰是如何只'
加上兩端,而','
更換空間...
到目前爲止,我都這樣了,這是不行的......
$string = str.replace(/\s+/g, '','',$string);