我試圖列出所有逗號(hào)分隔的值。 <?php $records = [ ["WLP001","Cream Ale,Dusseldorf Altbier,Kolsch,Ordinary Bitter"], ["WLP002","American Amber,American Brown Ale,American India Pale Ale,American Pale Ale,American Porter,Apple Wine,Barleywine Ale,Common Perry,Cream Ale,Dusseldorf Altbier,English Brown Ale,English Cider,English India Pale Ale,English Old Ale,English Pale Ale,Extra Special Bitter,Foreign Export Stout,French Cider,Irish Dry Stout,Irish Red Ale,Kolsch,Oatmeal Stout,Ordinary Bitter,Scotch Ale (Wee Heavy),Sweet Stout,Wheat Ale"],]; for ($i=0; $i < count($records); $i++) { $styles = explode(',',$records[$i][1]); echo $styles[0]."<br>"; } ?>例如對(duì)于“WLP001” 和“WLP002” Cream Ale, Dusseldorf Altbier, Kolsch, Ordinary Bitter, American Amber, American Brown Ale, American India Pale Ale,只要數(shù)據(jù)以逗號(hào)分隔,它就會(huì)繼續(xù)其余部分。因?yàn)楝F(xiàn)在的輸出是
使用 PHP 列出所有逗號(hào)分隔值
拉風(fēng)的咖菲貓
2024-01-19 09:50:40