[請益] php換行疑問
不好意思 請教一下
有爬過相關文章 php 顯示換行的文章
但使用後還是有點問題 我使用nl2br
不過顯示出來的內容
一樣沒有換行 然後每一筆資料接著下去
我不知道換行的部份哪個用錯了 想請教一下各位
我的程式是
================================================
<?php
$link = @mysql_connect("localhost", "root", "psd") or die("無法連上資料
庫喔!" . mysql_error());
switch ($_REQUEST['op']) {
default:
$main=show();
break;
}
echo make_page($main);
//畫面呈現
function make_page($main){
$page="
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=big5'>
<link rel='stylesheet' type='text/css' media='screen' href='pdf.css'>
<title>title</title>
</head>
<body background='images/bg.gif'>
<div class='center_block'>
<img src='images/logo.jpg' class='logo'>
<div class='toolbar'>
<a href='{$_SERVER['PHP_SELF']}?op=input_form'>輸出</a>
</div>
$main
</div>
</body>
</html>";
return $page;
}
function show(){
global $link;
mysql_query('SET NAMES big5');
$sql="select content from mdl_post";
$result=mysql_db_query("moodle",$sql,$link) or die ("無法抓到資料!<br>".$sql);
while($content=mysql_fetch_row($result)){
$contnet=nl2br($content);
$main.="$content[0] ";
}
return $main;
}
?>
=============================================================
出來顯示的資料每筆都沒有自己換行 然後一筆接著一筆這樣
問題是出在哪了呢?
謝謝指教
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.165.181.64
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章