I am scrapping data out of a file, from that data i'm getting the year out. When i try to convert that year (2011) to an int, i get a weird result (2). Here's what my code looks like. $year is the value i am getting from the file.
$year_int = (int) $year;
var_dump($year); //Return string(8) "2011"
var_dump($year_int); //Return int(2)
I expect $year_int to be an int(2011). And why is $year a string(8) shouldn't it be a string(4)?