将变量放在已包含在数组中的图像URL中

时间:2012-08-23 06:33:58

标签: php wordpress

我有代码

array( "name" => "Services Widget Description",
       "desc" => "Max 500 character(Use new line for new Point)",
       "std"=>"<ul>
                  <li>
             Rebum corrumliit neglegentur sit at,
           <img class='line22' width='243' height='2' alt='text line' src='images/text-line.jpg'>
        </li>
               </ul>"
),

URL是一个包含http://localhost/Junk的变量,我想在src中使用这个变量,我试过这样的

array( "name" => "Services Widget Description",
       "desc" => "Max 500 character(Use new line for new Point)",
       "std"=>"<ul>
                  <li>
             Rebum corrumliit neglegentur sit at,
           <img class='line22' width='243' height='2' alt='text line' src=URL.'images/text-line.jpg'>
        </li>
               </ul>"
),

但没有用,请指导如何使用

1 个答案:

答案 0 :(得分:0)

URLCONSTANT而不是变量。

在代码URL

中整合".URL."
array( "name" => "Services Widget Description",
       "desc" => "Max 500 character(Use new line for new Point)",
       "std"=>"<ul>
                  <li>
                      Rebum corrumliit neglegentur sit at,
                      <img class='line22' width='243' height='2' alt='text line' src='".URL."images/text-line.jpg'>
                  </li>
               </ul>"
),