2015-02-03 3 views
0

저는 젠 카트 기반 시스템에서 이미지 배너를 반향 출력하는 데 사용하는 PHP 에코가 있습니다.PHP 문제, 일부 페이지에는 슬래시가 표시되지만 다른 페이지에는 표시되지 않습니다.

<hgroup id="cat_banner" style="background-image:url(images/categories/banners<?php echo"/"; echo strtolower(str_replace('&','and',str_replace(' ','_',$breadcrumb->last()))); ?>_banner.jpg);"> 

<h1 id="productListHeading"><?php echo $breadcrumb->last(); ?></h1> 
<?php 

// categories_description 

    if ($current_categories_description != '') { 

?> 

<p id="indexProductListCatDescription" class="content"><?php echo $current_categories_description; ?></p> 

<?php } // categories_description ?> 

일부 이미지는 /가 보이지 않지만 다른 이미지는 보이고 이미지는 표시됩니다.

+0

죄송합니다. 코드가 올바르게 추가되지 않았습니다. (str_replace ('&', 'and', str_replace ('', '_')) – mattbough

+0

하드 코딩 대신에 슬래시를 왜 에코합니까? – julekgwa

+0

하드 코딩을했는데, 어떤 차이가 있는지 알아보기 위해 여러 가지를 시도해 보았습니다. – mattbough

답변

0
$path = strtolower(str_replace('&','and',str_replace(' ','_',$breadcrumb->last()))); 
<hgroup id="cat_banner" style="background-image:url("images/categories/banners/".$path."_banner.jpg)> 
+0

유감스럽게도, 슬래시가 있어야하는 링크 사이에 공백이 추가되었습니다. – mattbough

관련 문제