Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在php中获取从方法生成的值_Php_Methods_Return Value - Fatal编程技术网

在php中获取从方法生成的值

在php中获取从方法生成的值,php,methods,return-value,Php,Methods,Return Value,我有一个关于获取方法值的问题 custom_get_post_attachments(get_the_ID(), $__width, $__height, get_the_title()) 此代码生成html代码() 如果我回显该方法,它将显示图片,我不需要显示 我需要得到生成的html代码。如果不显示图片,我怎么做 谢谢如果您不希望对HTML进行评估,则需要对其进行转义 echo htmlentities(custom_get_post_attachments(get_the_ID(), $

我有一个关于获取方法值的问题

custom_get_post_attachments(get_the_ID(), $__width, $__height, get_the_title())
此代码生成html代码(

如果我回显该方法,它将显示图片,我不需要显示

我需要得到生成的html代码。如果不显示图片,我怎么做


谢谢

如果您不希望对HTML进行评估,则需要对其进行转义

echo htmlentities(custom_get_post_attachments(get_the_ID(), $__width, $__height, get_the_title()));

echo
更改为
return
相同的内容。。显示图片