,可以通过以下步骤完成:
$students = array(
array("name" => "张三", "age" => 18, "score" => 90),
array("name" => "李四", "age" => 20, "score" => 85),
array("name" => "王五", "age" => 19, "score" => 95)
);
<div class="card-deck">
<?php foreach ($students as $student): ?>
<div class="card">
<div class="card-body">
<h5 class="card-title"><?php echo $student['name']; ?></h5>
<p class="card-text">年龄:<?php echo $student['age']; ?></p>
<p class="card-text">成绩:<?php echo $student['score']; ?></p>
</div>
</div>
<?php endforeach; ?>
</div>
这样,你就可以将PHP数组导入到Bootstrap卡中,并在页面上展示出来。
推荐的腾讯云相关产品:腾讯云云服务器(CVM)和腾讯云对象存储(COS)。
没有搜到相关的文章