gpt4 book ai didi

php - 将 echo 置于后台 : url($variable)

转载 作者:行者123 更新时间:2023-11-28 15:47:53 24 4
gpt4 key购买 nike

我有这样的功能:

function abc(){

if ( of_get_option('pattern_option') != '' ) {

$pattern = of_get_option('pattern_option');

$custom_pattern = '

html{
background: url('.echo $pattern .') repeat !important;
}
.page_site{
background: url($pattern) repeat !important;
}
';
};
};

如何回显后台 URL,我尝试了很多方法但没有任何帮助,总是出现解析错误。

谢谢你的时间

最佳答案

您需要使用 . operator 将您的 $pattern 变量连接到字符串本身.

换句话说,

$custom_pattern = '
html{
background: url('.$pattern.') repeat !important;
}
.page_site{
background: url('.$pattern.') repeat !important;
}
';

关于php - 将 echo 置于后台 : url($variable),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42389391/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com