我将我的 xml 代码作为长文本存储在 MySql DB 中。我只想按原样打印出xml代码以进行筛选。只有 var_dump() 有效,但它显示字符串“输出”文本长度。我不想要字符串和文本长度我的代码:
$sql = 'SELECT xmlData, date, time FROM table order by idtable desc limit 0,1';
mysql_select_db('db');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($retval, MYSQL_NUM))
{
//attempt 1
/*ob_start();
var_dump($row[0]);
$result = ob_get_clean();
echo $result; */
//attempt 2
//var_export($row[0], true);
//attempt 3
//$dump = print_r($row[0], true);
//$dump = var_export($row[0], true);
//attempt 4
//nl2br($row[0]);
//attempt 5
//$wordParLine = 10;
//wordwrap('$row[0]', $wordParLine);
//attempt 6
$var1 =$row[0];
$new = substr($var1,0,2170);
}