Need to read a file, search for some data and output the data using PHP
- by Kyle
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