PHP echo中输出更改的顺序 [英] Order of output changes in php echo

查看:125
本文介绍了PHP echo中输出更改的顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望这是一个简单的修复程序,由于某种原因,当我运行此修复程序时。我正在运行wordpress并使用高级自定义字段插件

Hopefully this is a simple fix, for some reason when I run this. I am running wordpress and using the advanced custom fields plugin

echo "Tickets Start at CA$" . the_field('price');

我得到此输出

50Tickets Start at CA$

相反,我想发生的事情是

Instead of, what I want to happen which is

Tickets Start at CA$50

任何想法我在做什么错

推荐答案

实际上,如@smith所说 the_field()显示该字段的值。您想使用 get_field()来代替返回值而不是显示它。

Indeed, as @smith says the_field() displays the value of the field. You want to use get_field() instead which returns the value instead of displaying it.

这篇关于PHP echo中输出更改的顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆