ironfoot495
Technical User
I'm having a lot of trouble working on Os windows XP.Idownloaded the phpedit program and using the book PHP COOKBOOK, written by David Sklar and Adam Trachtenburg. Every time I put in some of the code in this book I get an Parsinjg error message.
<php Code </>
<HTML>
<HEAD>
<TITLE> Parsing Fixed-Width Delimited Data</TITLE>
</HEAD>
<BODY>
<?php
$fp = fopen('fixed-width-records.txt','r') or die ("can't open file);
while ($s = fgets($fp,1024)) {
$fields[1] = substr($s,0,10); // first field: first 10 characters of the line
$fields[2] = substr($s,10,5); // second field: next 5 characters of the line
$fields[3] = substr($s,0,10); // third field: next 12 characters of the line
}
$ft = fclose($fp) or die("can't close the file");
// a function to do something with the fields
// process_fields($fields);
// You need to break apart fixed-width records in strings
?>
</BODY>
</HTML>
I really don't understand why I keep getting a parsing error, can someone tell me what's going on.
<php Code </>
<HTML>
<HEAD>
<TITLE> Parsing Fixed-Width Delimited Data</TITLE>
</HEAD>
<BODY>
<?php
$fp = fopen('fixed-width-records.txt','r') or die ("can't open file);
while ($s = fgets($fp,1024)) {
$fields[1] = substr($s,0,10); // first field: first 10 characters of the line
$fields[2] = substr($s,10,5); // second field: next 5 characters of the line
$fields[3] = substr($s,0,10); // third field: next 12 characters of the line
}
$ft = fclose($fp) or die("can't close the file");
// a function to do something with the fields
// process_fields($fields);
// You need to break apart fixed-width records in strings
?>
</BODY>
</HTML>
I really don't understand why I keep getting a parsing error, can someone tell me what's going on.