barkster Posted July 11, 2007 Share Posted July 11, 2007 I want to have a page that has some html text that I can change randomly and I want to include it into a string on a page so that I can change as needed. How can I do this? I'm looking at something like $html = "This is a test" . include(text.html) . "rest of text"; is this possible? Of course not like I have done it. Thanks Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 11, 2007 Share Posted July 11, 2007 You want random HTML to be run each time the script is run? Quote Link to comment Share on other sites More sharing options...
barkster Posted July 11, 2007 Author Share Posted July 11, 2007 No I just want the text from the html file. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted July 11, 2007 Share Posted July 11, 2007 One way you can do it is to open the HTML file for reading and add it to the string. Quote Link to comment Share on other sites More sharing options...
barkster Posted July 11, 2007 Author Share Posted July 11, 2007 It seems like I've done this somehow before but I can't find my posting. I was hoping for something simpler. Quote Link to comment Share on other sites More sharing options...
per1os Posted July 11, 2007 Share Posted July 11, 2007 <?php $file = file_get_contents('text.html'); $html = "This is a test" . $file . "rest of text"; Quote Link to comment Share on other sites More sharing options...
barkster Posted July 11, 2007 Author Share Posted July 11, 2007 That is what I'm looking for, I knew it was a one liner. Thnaks Frost Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.