开发者

PHP getting time by time format

I have 2 strings:

 1. "%Y%d%m-text.TXT"
 2. "20112104-text.TX开发者_开发问答T"

How can I get "20112104" using selected format? I can have in the first string format "%d%d%d", and my output should be "212121". Thank you in advance.


Is this what you are looking for?

$sFile = "%s-text.TXT";
$sFile = sprintf($sFile, date("Ydm"));

If not, please add more context.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜