我试图在PHP文档中使用CDATA标记,但不幸的是,当它输出时,CDATA标记之间的任何内容都被注释掉了。有谁知道为什么?
$fields = 'data=<?xml version="1.0" encoding="UTF-8"?>
<post>
<employer_email>#</employer_email>
<employer_password>#</employer_password>
<position_title>'.$post_title.'</position_title>
<position_ref>'.$postID.'</position_ref>
<position_region>'.$region1.'</position_region>
<position_city>'.$position_city1.'</position_city>
<position_industry>'.$job_category1.'</position_industry>
<position_job_type>'.$job_type1.'</position_job_type>
<position_job_description><![CDATA['.$mm.']]></position_job_description>
</post>';
echo "<pre>";
print_r ($fields);
然后它输出product_job_description
部分,如下所示:
<position_job_description><!--[CDATA[Associate Dentist /Penzance, Cornwall / Full Time.MBR Dental are currently assisting a dental practice located in Penzance, Cornwall to recruit an Associate Dentist to join their team.Full Time opportunity.5000 UDAs.£10 per UDA.Strong Private Potential.45/55 Private Fees .For more information please send your CV to #]]--></position_job_description>