Mat*_*iby 0 php regex wordpress preg-match
所以我使用这个wordpress函数来获取用户图像
the_author_meta('author_image', the_author_ID()
Run Code Online (Sandbox Code Playgroud)
它或者返回something.jpg或者something.png或者something.gif如果发现图像否则将返回像2330的整数,我会怎么做的preg_match或一些有条件的,让我知道如果图像是存在的.我正在考虑做一个preg_match来查看名称中是否有一段时间,但是如果有人有更好的想法,那将是很好的..
更简单:
if (is_numeric($author_image)){
// this is presumably not a file
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
236 次 |
| 最近记录: |