如何将 php 语句放入 php 语句内?
<?php cp_latest_tweet('<?=$next_fixture?>'); ?>
next_fixture
部分是我遇到麻烦的地方。我该怎么办?
<?php cp_latest_tweet('<?=$next_fixture?>'); ?>
The next_fixture
part is where I'm having trouble. How do I go about this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你到底为什么要这么做?
只需直接传递 var:
如果您想在其之前/之后有一个字符串,例如:
或
Why the hell would you do that?
Simply pass the var directly:
If you want to have a string before/after it, e.g.:
or
假设你的意思是:
Assuming you mean:
你已经解决这个问题了吗,前两个答案是正确的,但是你知道变量 $next_fixture 存在哪里吗?如果它位于您调用该函数的同一脚本中,那么您应该没有问题,但如果它位于另一个名为 next_fixture.php 的脚本中,您将必须将此脚本包含在您调用该函数的脚本中。如果是这种情况,您可以使用 require_once:
require_once('next_fixture.php');
然后:
cp_latest_tweet($next_fixture);
Have you got this fixed yet, the previous two answers are correct but do you know where the variable $next_fixture exists? if it's in the same script where you CALL the function then you should have no problem, but if it's in another script called something like next_fixture.php you will have to include this script in the one your calling the function from. If this is the case you can use require_once:
require_once('next_fixture.php');
and then:
cp_latest_tweet($next_fixture);