How do I get text as a variable contents from a TXT file between
certain "custom tags"?
Here is what I mean. If I have a text file named "info.txt" and it's contents are:
Code:
%%meta1%%
This is some dummy stuff for a tag that I might make
%%meta1%%
%%meta2%%
There can be more than one of the current sets
%%meta2%%
%%tag%%
Some of these tags might not even have the same name
%%tag%%
%%changes%%
And I might make a script to add to more tags to this file or
re-write it occasionally with new tags/contents
%%changes%%
Then in another PHP file I might want to get things like this:
PHP Code:
<?
$meta = array("Some of these tags might not even have the
same name", "There can be more than one of the current sets");
// or
$meta1 = "This is some dummy stuff for a tag that I might make";
// or
$tag = "Some of these tags might not even have the same name";
// etc....
?>
I assume I have to open, then search the TXT file for words that begin after a specified "tag" and end at the same
specified "tag" but I have no idea of the syntax to do that search.
Any help? SHould I be more clear?