Jump to content
php.lv forumi

Izlaiishana no txt


Jee

Recommended Posts

Man ir jautaajums! Piem, es txt failaa ierakstu vaardu un tekstu. Un ja shajaa tekstaa man vajag ierakstiit kaadu linku uz citu webadresi. Kaa var to linku izdabuut araa, lai priekshaa neraadiitos mana adrese?

Link to comment
Share on other sites

Es tekstu izlasu shaadi:

<?php
$cont = "skaits.txt";
$num = file($cont);
$num[0]++;

$a = $num[0];
$b = "$a.txt";
while($b >=1 ) {
if($b != $a++){

$content = file("$b.txt");
while($val = each($content)){
$tmp = explode("|+|",$val[1]);
$date = $tmp[0];

if ($tmp[3]==""){
$web = "";
}else{
$web="<a href=\"http://$tmp[3]\" target=\"_blank\">www</a>";
}

if($tmp[2]==""){
$vards=$tmp[1];
}else{ $vards="<a href=mailto:$tmp[2]>$tmp[1]</a>"; }
echo "<br><table align=\"center\" bgcolor=#ffffff width=98% cellspacing=0 cellpadding=0 border=\"0\">
      <tr><td background=\"img/aut.jpg\">$vards     $web</td></tr>
  <tr><td class=\"kal\" bgcolor=#f0f0f0><pre>$tmp[4]</td></tr>
  <tr><td><p align=\"right\" id=\"date\">$date</td></tr></table>";
}
}
$b = $b-1;
}
?>

Es katru rakstu ierakst jaunaa txt failaa!

Link to comment
Share on other sites

×
×
  • Create New...