顯示動態標籤在我index.php
,我試圖從發生內爆MySQL數據庫加載的meta標籤的數組。我試圖在<meta>
標記中回顯它。但它只顯示最後一個標籤。爲什麼這樣?在meta標籤
HTML
$meta_t=mysqli_query($con,"select * from tags");
while($row1=mysqli_fetch_array($meta_t,MYSQLI_ASSOC)){
$meta_tags=array();
$meta_tags[]=$row1['tag_name'];
$comma_separated = implode($meta_tags);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>GripOffers</title>
<meta name="keywords" content="<?php echo $comma_separated;?>">
'$ meta_tags =陣列();'< - 動議到外面的環的 –
'$ meta_tags =陣列();'< - 即,太 –