Read from text file..

ELADSC

New member
Read from text file..

I try to read with (fgets) from a text file that contains both heberw and english text mixed. My problem is the the PHP compiler ignores the new line and writes everything in one line. Note: I used--> $buffer = fgets($fp,4096); echo $buffer; Please help TODA RABA
 

YuvalCo

New member
הפתרון הקליל ביותר להבנה,

לדעתי, הוא <div align=left dir=ltr> $buffer=str_replace(" ","<br>",$buffer); </div> לא הכי חכם, כמו שאתה בטח רואה, אבל נראה לי שיהיה לך הכי קל להבין. חוץ מזה, בצורה הזו הוא לא קורא רק שורה אחת ? לא היית צריך <div align=left dir=ltr> $buffer .=fgets($fp,4096); </div> בשביל שזה יוסיף את זה כל פעם למשתנה ?? אם אתה קורא וישר מדפיס, ולכן כתבת את זה ככה, אז זה עוד יותר קל. עשה כל פעם <div align=left dir=ltr> print($buffer."<br>"); </div> בהצלחה.
 

YuvalCo

New member
|הקוד| ו|סקוד|לא עובדים פה, מסתבר..

במקום זה קיבלתי את הקוד שהם מחליפים איתו את שני הקודים האלה
 
למעלה