echo date("w",strtotime(date("Y-m-d")));
echo date("w",strtotime(date("Y年m月d日")));
Save it as utf8.You'll see the second is bigger than the first one.
echo date("w",strtotime(date("Y-m-d")));
echo date("w",strtotime(date("Y年m月d日")));
Save it as utf8.You'll see the second is bigger than the first one.
Mask,
most probably because strtotime is not able to parse properly the japanese formated date.
In my opinion, by reading the documentation it would accept date formated with -
but that's not explicitly said.
trying var_dump(strtotime(date("Y年m月d日"));
give false
so like in the documentation the strtotime
seems to fail to parse it.
so date apply on false
which don't give the same result.
If by "bigger" you mean "it uses more bytes", it's beacause UTF8 is an encoding with variable character size. A - character will be encoded with one single byte, while 年 will be encoded with at least two. See here: http://en.wikipedia.org/wiki/Utf8
The Asian characters take up 2 or more bytes when represented in UTF-8, while dashes only take one byte.
The main problem is that strtotime is expection a valid date in US format ( readyble here http://php.net/manual/en/function.strtotime.php )
to solve this you could use the function strftime
echo date("w",strftime(date("Y年m月d日")));
echo date("w",strftime(date("Y-m-d")));