【发布时间】:2010-11-03 06:21:50
【问题描述】:
嗨,Guy 知道如何完成这项工作吗?
<?php $themename_orig = get_bloginfo ( 'name' );
$clean = toAscii($themename_orig);
$shortname_opciones = $clean;
?>
body {
background:url("<?php echo $shortname_opciones."_bg_img"; ?>") no-repeat scroll center top
<?php echo $shortname_opciones."_color_bg"; ?>;
}
#logo
{
background: url("<?php echo $shortname_opciones."_logo"; ?>") 0 17px no-repeat;
}
基本上我的问题是我需要在将变量与字符串连接后回显它,该变量确实存在。
【问题讨论】:
-
从其他变量中获取变量名是非常糟糕的风格。我真的,真的建议您为此使用关联数组(或更好 - 虽然更复杂 - 一个对象)。它会为您以后省去很多麻烦。
标签: php string variables concatenation