我在我的模板中包含了custom.css文件,以允许网站所有者添加自己的css规则.但是,当我发送文件时,它是空的,如果他们没有添加任何规则,就没有意义加载它.
确定它是否空的最佳方法是什么?
if ( 0 == filesize( $file_path ) )
{
// file is empty
}
// OR:
if ( '' == file_get_contents( $file_path ) )
{
// file is empty
}
Run Code Online (Sandbox Code Playgroud) php ×1