trying to understand preg_match, struggling to understand how to write and how to access what it has matched. For example:
Every single movie name I have is in the format--
MOVIE NAME (YEAR)
e.g. Alice in Wonderland (2010)
I want to be able to get the movie title into a different variable from the string.
A few movies have parentheses outside of the year -- as in, The movie (Has One of These) (2008)
I'm iterating over an array of strings as well -- so I basically need to use preg_match to get to \([0-9]{4}\)$ (is $ the mark of an end of the line?) and then the rest of the string without that year as well in two variables.
Can anyone possibly help?
EDIT: Huh. I swear I typed \ . When I type \( it went into ( because I didn't double escape. Anyway, thank you guys very much! The site you linked it also awesome (helped with array problems, I didn't realize it kept full string at 0 as well).