回显变量。“_ string”(与字符串连接)

时间:2010-11-03 06:21:50

标签: php string variables concatenation

嗨,盖伊有任何关于如何使这项工作的想法吗?

<?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; 
}

基本上我的问题是我需要在将变量与字符串连接后回显变量,该变量确实存在。

2 个答案:

答案 0 :(得分:0)

background:url("<?php echo $shortname_opciones; ?>_bg_img")

答案 1 :(得分:0)

echo ${$shortname_opciones."_bg_img"};