Example file:
Aiken, L. S., & West, S. G. (1991). Multiple Regression: Testing and Interpreting
interactions. Sage Publications.
Bai, X., Yao, W., & Boyer, J. E. (2012). Robust fitting of mixture regression
models. Computational Statistics & Data Analysis, 56 (7), 2347-2359.
Bartolucci, F., & Scaccia, L. (2005). The use of mixtures for dealing with
non-normal regression errors. Computational Statistics & Data Analysis,
48 (4), 821-834.
If I do
file("example")
,Its considering like below:
1st line- Aiken, L. S., & West, S. G. (1991). Multiple Regression: Testing and Interpreting
2nd line- interactions. Sage Publications
but it should be in a single line. So, I need to make that two lines as single line based on the space which second line have.As such I need all the reference list to be structured.
If I do like this,
$data = str_replace("\r\n", "", $data);
then all the lines will become as single line. I want each reference to be single line.
I tried,
$f=file("example")
for($i=0;$i<count($f);$i++){
$f[$i] = str_replace("\r\n", "", $f[$i]);
????
}