dot Posted March 14, 2005 Report Posted March 14, 2005 man ir txt fails dati.txt kaa lai failaa ar php paliidziibu atrod kaadu noteiktu vaardu vai vaardus un smuki izdruka taas rindinjas kuraas tas vai tie vaardi atrodas. paldies jau iepriekss.
Kavacky Posted March 14, 2005 Report Posted March 14, 2005 $dati = file('dati.txt'); $dati - masīvs, kurā tagad ir visas rindiņas, katra vienā elementā. Ņem pa vienai un pārbaudi, vai atrodams vajadzīgais teksts, ja ir - drukā ārā.
Venom Posted March 14, 2005 Report Posted March 14, 2005 $lines=file('dati.txt'); $search=strtolower('something'); while($line=array_shift($lines)) if (strpos(strtolower($line),$search)!==false) echo '<br />'.$line;
dot Posted March 14, 2005 Author Report Posted March 14, 2005 taa arii domaaju, ka nekas garss nebuus, tuuliit paarbaudiishu, paldies :)
Kavacky Posted March 14, 2005 Report Posted March 14, 2005 taa arii domaaju, ka nekas garss nebuus, tuuliit paarbaudiishu, paldies :)Viss ģeniālais taču ir vienkāršs. :)
Recommended Posts