View Single Post
  #1 (permalink)  
Old 07-23-03, 04:53 AM
paulj000 paulj000 is offline
Bull in a china shop
 
Join Date: Jul 2003
Location: California, USA
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
how to get info from TXT file between %%customTags%% as vars??

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?
Reply With Quote