PHP 带有格式化程序的变量输入:检查是否为空

PHP variable input with formatter: Check if empty

我必须检查我的代码输出是否为空。

这是我的代码:

<?php 
print check_markup($row->text, 'linkpreview', '', FALSE);
?>

check_markup 是我需要的格式过滤器 (Drupal),因为结果是 HTML。 详情:https://api.drupal.org/api/drupal/modules!filter!filter.module/function/check_markup/7

我怎样才能应用类似的东西:

<?php 
$new_stuff = 'check_markup($row->text, 'linkpreview', '', FALSE)';
print $new_stuff;
if (!empty($new_stuff)) {
print 'Test';
}
?>

抱歉,我很少需要处理PHP,我查看了whosebug.com中的相关问答,但没有找到答案。

check_markup() 看起来像函数,你应该这样使用它:

$new_stuff = check_markup($row->text, 'linkpreview', '', FALSE);
if(!empty($new_stuff)){
    print 'yay, not empty!';
}