How to explode an array of strings and store results in another array (php)
问题 Have text file in format: (400, 530); 6.9; 5.7; 5.0;//------> continues for 100 values. (500, 530); 7.9; 5.1; 5.0; (600, 530); 6.7; 6.7; 7.2; Code: <?php $file="./Speed10.asc"; $document=file_get_contents($file); $rows = explode ('(', $document); //splits document into rows foreach ($rows as &$rowvalue) { explode (';', $rowvalue);<----- How to assign each of these to member of an array?? } } ?> I'm trying to create 2D array, by splitting first into rows, then by element split by ';' 回答1: