Jump to content
php.lv forumi

Apvienot...


barons

Recommended Posts

ir divi skripti:

 

1) $f = file('java/action/action.txt');

for ($i=0;$i<=1;$i++) {

$rindas= $f[$i];

print("<br>$rindas");

}

 

iznaakums1:

 

1:Nosukums1:Apraksts1

2:Nosaukums2:Apraksts2

 

2)$content = file('java/action/action.txt') ;

while ($val = each($content)) {

$tmp = explode(":",$val[1]);

print("<br>$tmp[1]<br>");

 

}

 

iznaakums2:

 

Nosukums1

 

Nosaukums2

 

Nosukums3

 

Nosaukums4

 

Kā abus apvienot vai uzrakstiitu, lai sanaaktu shaadi:

 

Nosukums1

 

Nosaukums2

 

:unsure:

Link to comment
Share on other sites

Ak dies, skaitīt līdz divi nemāki?

2)$content = file('java/action/action.txt');
$count = 0;
while (($val = each($content)) && ($count<2)) {
 $tmp = explode(":",$val[1]);
 print("<br>$tmp[1]<br>");
 $count++;
}

Link to comment
Share on other sites

Ak dies, skaitīt līdz divi nemāki?

2)$content = file('java/action/action.txt');
$count = 0;
while (($val = each($content)) && ($count<2)) {
 $tmp = explode(":",$val[1]);
 print("<br>$tmp[1]<br>");
 $count++;
}

15017[/snapback]

 

Paldiesinj!

Tagad tikai jaaizdomaa kaa paraadiit naakamaas divas rindinjas bez pirmaam <_<

Link to comment
Share on other sites

Nu jopcig! Cilvēki for ciklus nemāk lietot! :)

$no = 1;   // skaita no 0
$skaits = 2; 
$content = file('java/action/action.txt');
for ($i=$no; $i<$no+$skaits; $i++) {
  $tmp = explode(":",$content[$i]);
  print("<br>$tmp[1]<br>");
}

Edited by bubu
Link to comment
Share on other sites

Nu jopcig! Cilvēki for ciklus nemāk lietot! :)

$no = 1;   // skaita no 0
$skaits = 2; 
$content = file('java/action/action.txt');
for ($i=$no; $i<$no+$skaits; $i++) {
  $tmp = explode(":",$content[$i]);
  print("<br>$tmp[1]<br>");
}

15028[/snapback]

 

Nu feini, un es pusi dienas domaaju :D

Link to comment
Share on other sites

×
×
  • Create New...