在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
相同的内容。。显示图片