substr() is not working as expected
问题 I am just trying to extract the date's year , month and day separately so that I can use it as per my wish. I stored the current date in $today and used substr() to extract the strings from it. But I am getting some strange behaviour from what I am doing. My current code: $today = date("Y/m/d"); $_year = substr($today, 0,4); $_month = substr($today, 5,7); $_day = substr($today, 8, 10); echo $_year . " " . $_month; The $_year works correctly as expected but the problem arises from $_month , no