I am trying to create a madlibs game ..
I have a txt file with paragraphs in it .. Some of the sentences have the following tags in it <#noun>, or <#verb>, etc ...
I need to parse the file in php and display the content in between the tags to the user.
The user can fill the the words in text box, and the story will be displayed with the new words instead of the tags.
Here is an example of the text file:
One day, I was walking through the <# adjective #> part of
Toronto when I ran into a huge stack of <# plural noun #>!
It was the most <# adjective #> sight I had ever seen. I tried
to call my best friend, <# proper noun #>, to tell <# him/her #>
about it but all of the phone circuits were busy.
Thanks in Advance,
Vladimir
creating madlibs in php
Moderator: General Moderators
-
cpetercarter
- Forum Contributor
- Posts: 474
- Joined: Sat Jul 25, 2009 2:00 am
Re: creating madlibs in php
Are the textboxes on the same page as the paragraph of text? If so, I would use Javascript to replace <#verb> etc with the contents of the textboxes.
Re: creating madlibs in php
It's on two different pages. Thx