dtye7921 2014-10-18 10:26
浏览 33
已采纳

Double vs SIngle Quotes问题

Can someone help me to write this correct, i am strugling. And could someone explain to me how to combine single and double quotes in best way??? I have issue in line

value = "<?php echo $client['name_'.$key];?>"

my whole code is

<?php
    foreach($this->config->item('languages') as $key=>$value)
    {
        echo '<div id="edit-fragment-'.$key.'">
        <table class="form_horizontal" width="100%">

        <tr>
            <td class="field">'.lang('polls_txt_title').'</td>
            <td class="value"><input type="text" name="client_'.$key.'" value = "<?php echo $client['name_'.$key];?>"; /></td>
        </tr>

        <tr>
            <td class="field">'.lang('polls_txt_vote').'</td>
            <td class="value"><input type="text" name="polls_'.$key.'_vote" value="'.$this->mConfig->item('polls_'.$key.'_vote').'" /></td>
        </tr>



        </table>
        </div>';
    }
    ?>
  • 写回答

4条回答 默认 最新

  • dpqaaczn141761 2014-10-18 10:27
    关注

    Try like

    value = "<?php echo $client['name_'.$key];?>";
    

    As per your edited question see my second answer

    '<td class="value"><input type="text" name="client_'.$key.'" value = "'.$client['name_'.$key].'" /></td>'
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 QTOF MSE数据分析
  • ¥15 平板录音机录音问题解决
  • ¥15 请问维特智能的安卓APP在手机上存储传感器数据后,如何找到它的存储路径?
  • ¥15 (SQL语句|查询结果翻了4倍)
  • ¥15 Odoo17操作下面代码的模块时出现没有'读取'来访问
  • ¥50 .net core 并发调用接口问题
  • ¥15 网上各种方法试过了,pip还是无法使用
  • ¥15 用verilog实现tanh函数和softplus函数
  • ¥15 Hadoop集群部署启动Hadoop时碰到问题
  • ¥15 求京东批量付款能替代天诚