SO far, I've tried everything... fread, fgets, get_file_contents, and I'm still getting nothing. Here's my current code:
$file_handle = fopen("menu_pt1.txt", "rb");
while (!feof($file_handle))
{
$contents .= fread($file_handle, 4096);
}
fclose($file_handle);
echo "s ".$contents;
menu_pt1.txt is in the same directory as this file, so there's no problem with finding it.
I get no output whatsoever. I've tried and tried and tried.
What I want to do is to read three separate sections of text files. These files contain program code. I then want to insert new code between the pieces, and then write the resulting output to a new file. This is driving me batty, and I have no idea what I'm doing wrong.
Does the contents of the file make a difference? Any ideas? Here are the first few lines of the first file I'm trying to read:
<!-->
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<!-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script language="javascript" type="text/javascript">
.
.
.
I'm totally lost here. 🙁