Jump to content
php.lv forumi

Recommended Posts

Posted

Tatad man ir mazinsh saraksts ar vaardiem txt faila. Katrs sava rinda. Ka ar php es varu panemt vienu vardu, ar vinu izdariit darbiibas un talak panemt nakosho vardu utt.?

Posted

ja teksta faila rindas atdalitas ar enter, tad f-ju file nolasi un ar ciklu (piem. foreach ) izej cauri un veic savas darbibas.

Posted
<?php

$lines = file('vaardi.txt');

foreach ($lines as $line) {

$kautkas = rtrim($line);

echo "$kautkas<br />";

}
?>

×
×
  • Create New...