Need to read a file, search for some data and output the data using PHP

Posted by Kyle on Stack Overflow See other posts from Stack Overflow or by Kyle
Published on 2010-06-02T01:41:41Z Indexed on 2010/06/02 1:43 UTC
Read the original article Hit count: 362

Filed under:
|

Hello...I am new to PHP (never really used it before tonight) and I need to use a PHP script to read the contents of a file on my website (http://kylemills.net/Geocaching/BadgeGen/MacroFiles/BadgeGenBeta.gsk) and then take some specific varying data and output it.

For example: If my file contains the text:


random text
Here is some text
#There is some text here too
$Version = "V2.2.23 Beta"
random text
#some more text
$Text="some text"

If the above was the contents of my file, I need the script to return "V2.2.23 Beta" (without quotes). The idea is that as I update the file, the version changes and I want this to be reflected across my site.

I am sorry if I don't make any sense...any help would be appreciated :)

-Thanks so much, Kyle

© Stack Overflow or respective owner

Related posts about php

Related posts about html