neprasa Posted November 17, 2006 Report Share Posted November 17, 2006 (edited) kas te nepareizs $f= "aaaaa.txt"; $1 = fopen($f, 'r'); $2 = fgets($1); $echo "$2"; Edited November 17, 2006 by neprasa Link to comment Share on other sites More sharing options...
andrisp Posted November 17, 2006 Report Share Posted November 17, 2006 (edited) 1) mainīgo nosakumi nevar sākties ar ciparu vai būt tikai cipari, 2) $echo ? wtf ? 3) Un jā - nepareizs fgets pielietojums. Labāk paskaties, ko vienkāršāku - http://lv.php.net/manual/en/function.file-get-contents.php Edited November 17, 2006 by andrisp Link to comment Share on other sites More sharing options...
neprasa Posted November 17, 2006 Author Report Share Posted November 17, 2006 blje sajuka , bet echo "$2"; ari neiet , un ja man nevajag echo ari tad neiet un rada wrong parameters count for fgets Link to comment Share on other sites More sharing options...
andrisp Posted November 17, 2006 Report Share Posted November 17, 2006 Tu vispār izlasīji, ko es tev saku ? Link to comment Share on other sites More sharing options...
neprasa Posted November 17, 2006 Author Report Share Posted November 17, 2006 jaa pamainiju uz to fread utt. tapat neiet Link to comment Share on other sites More sharing options...
andrisp Posted November 17, 2006 Report Share Posted November 17, 2006 Parādi, ko uzrakstīji. Link to comment Share on other sites More sharing options...
neprasa Posted November 17, 2006 Author Report Share Posted November 17, 2006 fget nomainiju pret fread Link to comment Share on other sites More sharing options...
andrisp Posted November 17, 2006 Report Share Posted November 17, 2006 Tu nu gan esi izsmeļošs. Varu derēt, ka mainīgos nemaz nepārsauci. Tāpat ar fread nepareizi izmanto. Exampļos apskatījies kā tas jādara ? Link to comment Share on other sites More sharing options...
neprasa Posted November 17, 2006 Author Report Share Posted November 17, 2006 visu pamainiju, bet examplos tur ir gars kods nevis paris rindu Link to comment Share on other sites More sharing options...
andrisp Posted November 17, 2006 Report Share Posted November 17, 2006 <?php // get contents of a file into a string $filename = "/usr/local/something.txt"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); ?> OMG, five lines of code ! :) Link to comment Share on other sites More sharing options...
blackhalt Posted November 17, 2006 Report Share Posted November 17, 2006 $f= 'aaaaa.txt'; echo file_get_contents($f); Link to comment Share on other sites More sharing options...
Recommended Posts