php - Explode every line from text file -


i facing serious problem on days. trying explode each line something.txt file , make array. array structure not want. code given below

    ( $i=0; $i<count($_files['data']['name']['question']['uploadfiles']); $i++) {         foreach(file($_files['data']['name']['question']['uploadfiles'][$i]) $line) {             $linedata[] = explode("\n",$line);         }     } 

some of file lose proper array structure. like

    array     (         [0] => array             (                 [1] =>      a. hemophilia     b. hemophilia b                 [2] => c. von willebrand disease     d. idiopathic thrombocytopenic purpura             )      ) 

but want array structure this:

array (     [0] => array         (             [1] => a. hemophilia             [2] => b. hemophilia b             [3] => c. von willebrand disease             [4] => d. idiopathic thrombocytopenic purpura         )  ) 

try using carriage return "\r" instead of line feed "\n".

according this article, mac different windows , linux in respect.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -