Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在下面的代码中,如何将 VAR 设置为某个变量,然后将其包含在 SimplePie 代码中作为提要 URL?“提要”代码来自 Simplepie PHP 库。
<?php $VAR = "http://website.com/feed/"; $feed1 = new SimplePie(); $feed1->set_feed_url('$VAR'); $feed1->init(); ?>
我不确定简单派。但是,如果您使用单引号,它将不会被处理。尝试双引号或更好,您不需要任何引号。尝试这个 :
$feed1->set_feed_url($VAR);