我有meta\\u键“oyuncular”,它有带换行符的meta值。我想得到它们并显示在带有两列的表中。名称和角色名称
$names = get_post_meta( get_the_ID(), \'oyuncular\', true );
$namesArray = explode( \'\\n\', $names);
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr class="table-success">
<th>#</th>
<th>Name</th>
<th>Role Name</th>
</tr>
</thead>
<tbody>
<?php
foreach( $namesArray as $key => $name ) { ?>
<tr>
<th scope="row">1</th>
<td>Name</td>
<td>Role Name</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>