this is my code
<?php
$data=file_get_contents('./people.txt',true);
echo "$data"."<br>";
$newdata=str_replace(" ",";",$data);
echo "$newdata"."<br>";
$file=explode(";",$newdata);
$len=count($file);
echo "$len"."<br>";
for($i=0;$i<$len;$i++)
{
echo "$file[$i]"."<br>";
}
?>
which opens this text file(link given)
n the out put i'm getting is
how are you where are you i'm here and you
how;are;you where;are;you i'm;here and;you
7
how
are
you where
are
you i'm
here and
you
the last word of a line and the first word of the next line is being treated as a single word...is there any way to join the lines avoiding line breaks...
Attached File(s)
-
people.txt (38bytes)
Number of downloads: 17

New Topic/Question
Reply



MultiQuote






|