我的 php 代码在下面,它产生的源代码为我提供了我想要保存为 xml 文件的数据。我怎么能这样做?
ini_set ("display_errors", "1");
error_reporting(E_ALL);
session_start();
include_once('function.php');
$select_query = build_select_query("xml","cust_id",$_SESSION['cust_id']);
$query = mysqli_query($link,$select_query);
$num_rows = mysqli_num_rows($query);
if($num_rows > 0){
while($row = mysqli_fetch_assoc($query)){
?>
<all>
<Phonebooks>
<book id='{$row['bookid']}' Bookid='{$row['bookid']}' speedid='{$row['speedid']}' accountid='{$row['accountid']}'
GroupName='{$row['groupid']}' FirstName='{$row['firstname']}' Username='{$row['username']}'
MobileNum='{$row['mobilenum']}' OfficeNum='{$row['officenum']}' OtherNum='{$row['othernum']}' NewVer='{$row['newver']}' ISUseBLF='{$row['isuseblf']}'
LastName='{$row['lastname']}' GroupNameTwo='{$row['groupnametwo']}' />
</Phonebooks>
</all>
<?php
}
}
?>