So, lets say that I have a text file that contains some information on a client.
Name=RichardBaxton
Age=21
Nicks=ReconRoverRick
Company=MorganIndustries
Obviously there are better ways to store information about people, but for the sake of the situation, I’ll say that I’m a stubborn idiot who wants it to be like this.
What I am trying to do is extract the “ReconRoverRick” part, and put it in a string (Lets say, $nick). However, since the file is always changing, and it always changes at random, I have no clue on how to do this. The Nicks=ReconRoverRick part could change to Nicks=KingBax or something.
Can I get some help?
It looks like the file you’re parsing is very similar format to an ini file.
You could try using php’s built-in function
parse_ini_file(link)Example: