admin管理员组文章数量:1335386
I'm sure there is a simple reason/answer for this: Why does
echo 'Archive for '. the_time('Y');
give me 2010Archive for
? I had expected it would give me
Archive for 2010
I'm sure there is a simple reason/answer for this: Why does
echo 'Archive for '. the_time('Y');
give me 2010Archive for
? I had expected it would give me
Archive for 2010
2 Answers
Reset to default 8As most template tags that start with the_
this one echoes time and not returns it (which template tags that start with get_the_
do).
First the_time()
fires and echoes year, then its return (null
) gets concatenated and echoed with string.
So:
echo 'Archive for ';
the_time('Y');
Or:
echo 'Archive for ' . get_the_time('Y');
You can also use ',' instead of '.' for concatenating strings in echo funcion.
echo 'Archive for ' , the_time('Y');
本文标签: phpWhy does this echo values in the wrong order
版权声明:本文标题:php - Why does this echo values in the wrong order? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742387569a2465339.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论