duanping1920 2016-09-21 19:59
浏览 27
已采纳

div内部回声功能

i have this

<?php
            } // if ( $coupons )

            do_action('st_after_coupon_listings');
            echo wpcoupon_store()->get_extra_info();

            wp_reset_postdata();
 ?>

and i want to get_extra_info() inside of <div class="mydiv"></div>

I tried

echo "<div class="mydiv">;
echo wpcoupon_store()->get_extra_info();
echo "</div>";

but this did not work.

I am making mistakes somewhere in syntax, it would mean a lot if someone could help.

  • 写回答

1条回答 默认 最新

  • douhuan1901 2016-09-21 20:02
    关注

    Yes, there is a syntax error, you missed a quote" replace the bottom code with

    echo '<div class="mydiv">';
    echo wpcoupon_store()->get_extra_info();
    echo '</div>';
    

    or if you wish to keep the outer quotes constant you could use

    echo "<div class=\"mydiv\">";
    echo wpcoupon_store()->get_extra_info();
    echo "</div>";
    

    but this is a bit harder to read

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?