doujun1495 2012-06-21 18:33
浏览 206
已采纳

是否可以在单引号字符串中插入变量?

<?php $header_string = '<a href="get_bloginfo('url')">Holiday</a>'; ?>

How do I insert get_bloginfo('url') correctly inside the single quoted string above?

  • 写回答

2条回答 默认 最新

  • douzhuo1858 2012-06-21 18:33
    关注
    <?php $header_string = '<a href="' . get_bloginfo('url') . '">Holiday</a>'; ?>
    

    Note the use of the dots (.), which are used for concatenating strings.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?