簡體   English   中英

PHP 如果和<img>不顯示圖像

[英]PHP If and <img> not displaying image

當我寫:

<?php if ( 1==1 ) : ?>
 Working
<?php endif ?>

它正在工作,我的意思是它正在顯示“正在工作”,但是當我寫:

<?php if ( 1==1 ) : ?>
        <img class="up" src="/wp-content/themes/template/img/up.png">
<?php endif ?>

它沒有顯示任何內容,如果我輸入:

<img class="up" src="/wp-content/themes/template/img/up.png">

在 IF 語句之外它正在顯示該圖像。 請幫忙!

某些 php 版本不支持 ":" 結構。 試試這個:

<?php if ( 1==1 ) { ?>
        <img class="up" src="/wp-content/themes/template/img/up.png">
<?php } ?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM