我如何显示多选收音机中的小数值

时间:2019-01-05 12:34:47

标签: php

这是我的第一个问题

<div class="content-block content-block-horizantal">
    <div class="content-block-ttl">Vaccinations History</div>
    <div class="content-block-main">
        <div class="content-radio">
            <label>Do you now or have you ever had:</label>
            <div>
                <?php $medical = json_decode($result['about'], true); ?>
                <div class="row">
                    <div class="col-sm-6 col-md-4 content-radio-container">
                        <div>
                            <input type="checkbox" name="medical[DP]" value="checked" id="DP" <?php if (isset($medical['DP'])) { echo $medical['DP']; } ?> >
                            <label for="DP"><span><i class="fa fa-check"></i></span><p>DP</p></label>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-4 content-radio-container">
                        <div>
                            <input type="checkbox" name="medical[DHPPI]" value="checked" id="DHPPI" <?php if (isset($medical['DHPPI'])) { echo $medical['DHPPI']; } ?>>
                            <label for="DHPPI"><span><i class="fa fa-check"></i></span><p>DHPPI</p></label>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-4 content-radio-container">
                        <div>
                            <input type="checkbox" name="medical[DHPPI_L]" value="checked" id="DHPPI_L" <?php if (isset($medical['DHPPI_L'])) { echo $medical['DHPPI_L']; } ?>>
                            <label for="DHPPI_L"><span><i class="fa fa-check"></i></span><p>DHPPI+L</p></label>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-input">
            <label>NOTES : </label>
            <textarea name="medical[other]" placeholder="NOTES"><?php echo json_decode($result['about'], true)['other'];?></textarea>
        </div>
    </div>
</div>

现在我只想将选定的值显示为“ DP,DHPPI,DHPPI_L”,如果有注释,则会在下一行显示

我使用了此代码,但仅查看注释

<div class="profile-data-value"><?php echo json_decode($user_data['about'],true)['other']; ?></div>

我该怎么办?

0 个答案:

没有答案