您的位置 首页 php

PHP在页面中原样输出HTML代码的方法介绍

本篇文章给大家介绍一下PHP在页面中原样输出HTML代码的方法。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。

PHP在页面中原样输出HTML代码的方法介绍

字符串与HTML之间的相互转换主要应用htmlentities()函数来完成。

1.png

<?phpheader("Content-Type: text/html; charset=utf-8");$str="<a href="www.php.cn">求知技术网</a>";echo $str;echo "<br>";echo htmlentities($str,ENT_QUOTES,"UTF-8");?>

运行结果为:

2.png

技巧:在应用此函数对字符串转换成HTML字符串的过程中,设置参数charset的字符集为utf-8,即可以避免在输出中文字符时出现乱码。

htmlentities() 函数把字符转换为 HTML 实体。

提示:要把 HTML 实体转换回字符,请使用 html_entity_decode() 函数。

提示:请使用 get_html_translation_table() 函数来返回 htmlentities() 使用的翻译表。

推荐:PHP视频教程

以上就是PHP在页面中原样输出HTML代码的方法介绍的详细内容,更多请关注求知技术网其它相关文章!

文章来源:智云一二三科技

文章标题:PHP在页面中原样输出HTML代码的方法介绍

文章地址:https://www.zhihuclub.com/1604.shtml

关于作者: 智云科技

热门文章

评论已关闭

29条评论

  1. traditional measures of cytotoxic or hormonal drug activity need to be clearly defined for assessing the benefits of cancer vaccine immunotherapy

  2. Reduction in CYP2D6 activity due to enzyme inhibitors or polymorphisms in the CYP2D6 gene has been shown to reduce endoxifen levels Borges et al

  3. of Breast Cancer Recurrences and Hazard Ratios According to Allocated Treatment and BMI Group for All Recurrences and Distant Recurrences

  4. A subgroup of people who had tumors that were human epidermal growth factor 2 positive seemed to have the greatest benefit from combination therapy

  5. Serious Use Alternative 1 trimipramine and artemether lumefantrine both increase QTc interval

  6. Examples of pharmaceutically acceptable base addition salts include sodium, potassium, calcium, ammonium, organic amino, or magnesium salt, or a similar salt

  7. Surveillance for endometrial cancer in women receiving tamoxifen Several prospective clinical trials have demonstrated that overall survival of patients receiving PET based radiation treatment planning was significantly higher than that of patients treated without the use of PET 24

  8. s CEO Don Thompson said establishing strategies that resonate with customers will be a key to the companyГў

  9. posaconazole will increase the level or effect of enzalutamide by affecting hepatic intestinal enzyme CYP3A4 metabolism

  10. The current analysis was limited to women with no personal history of breast cancer who underwent a routine screening mammogram in 2011 and who were not missing either breast density or residential zip code information n 285, 817 women

  11. These include tamoxifen and Aromatase Inhibitors AIs, such as letrozole, anastrozole, and exemestane That poor barfing woman didn t have anybody to speak up for her

  12. These processes also frame personalised medicine as mainstream, even as the technologies at its forefront may be rejected or become folded into the complexity of responsibilities and decision making involved in the navigation of cancer diagnostics and treatments by practitioners and patients

  13. Co administration of Furosemide and cephalosporin might increase the risk of nephrotoxicity

  14. SV40 Cre rTH AAV Wilson 108454 mCherry p2A CreERT2 FRT kan FRT For in vitro transcription of Cre or to recombine into BAC SP6 Bacterial Mercader Huber 108543 pLV EF1 Cre PGK Puro Cre EF 1 alpha Lentiviral Alcudia 108639 fli1aCreERT2 Cre ERT2; endothelial reporter fli1a Zebrafish Mercader Huber 108995 pDM1488 Cre; NeoR act15 D Pharmaceutics and drug delivery research

  15. Hair loss disorders comprise an extensive group of conditions that can be classified as scarring and nonscarring alopecia

  16. Bilateral oophorectomy or ovarian irradiation was allowed after at least 6 months of triptorelin

  17. First, re analysis of genome wide transcriptional profiling data revealed that 95 gene transcripts associated with mitochondrial biogenesis and or mitochondrial translation were significantly elevated in human breast cancer cells, as compared with adjacent stromal tissue His name is Shadow and he is my best bud

  18. Adapted with permission from 81 magnesium supplement will decrease the level or effect of potassium phosphate by Other see comment

  19. A majority of middle aged men and women eligible to take aspirin to prevent heart attack and stroke do not recall their doctors ever telling them to do so, according to a University of Rochester

网站地图