I am new to regex and really don't have a clue. I have a MySql table looking like this:
id | grade | subject | kind | tally
1 | 11 | M | L | 1
2 | 11 | E | L | 3
3 | 11 | D | G | 1
4 | 11 | GK | G | 1
5 | 11 | SPA | G | 6
you get the idea...:)
Grade is an int, either 11,12 or 13. Subject is a string, between 1-4 "chars" long. Kind is either "L" or "G". Tally is an int, between 1 and 6.
This table is supposed to hold all of the classes/lessons there are at my school. When you write out the classname it would look something like this "11EL4" or "11ML1".
I want to be able to turn this "description" into grade, subject, kind and tally. For example:
function descriptionToArray($description){
// $grade = regex voodoo :)
// $subject = regex voodoo :)
// ...
return array("grade"=>$grade,"subject"=>$subject,...);
}
My guess would have been regex but I really don't know how that works (even after tutorials)