How would I parse a text file into php. Here's an example of what I want.
constants.php:
<?php
define(PAGE_BODY, 'The body was displayed correctly');
?>
index.txt:
<html>
<head>
<title>INDEX</title>
</head>
<body>
{PAGE_BODY}
</body>
</html>
I want a class to be able to parse index.txt into a PHP file so that when I load index.txt into a php document it will display the contents of index.txt and the contents of PAGE_BODY which was defined in antoher php document. So it will end up looking like this through the source:
index.php:
<head>
<title>INDEX</title>
</head>
<body>
The body was displayed correctly
</body>
</html>
Parsing a text file into PHP
Moderator: General Moderators
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm