Parsing a String
Posted: Fri Mar 26, 2004 8:54 pm
Does anyone know how I could parse out a string?
Let's say I had the string "The best player is Kanag and his level is 1."
Now let's say I get this string from a file and want to only print the name of the person, in this case it's Kanag. What all would I need to do to get the name alone? Seeing as PHP has no specific types, I haven't really seen a way to run through a string and change it or even compare them.
Any help is appreciated.
Zorth.
Let's say I had the string "The best player is Kanag and his level is 1."
Now let's say I get this string from a file and want to only print the name of the person, in this case it's Kanag. What all would I need to do to get the name alone? Seeing as PHP has no specific types, I haven't really seen a way to run through a string and change it or even compare them.
Any help is appreciated.
Zorth.