从数据库中检索数据,不包括html标签

Nya*_*aro 0 html php mysql

如何从数据库中检索数据的数据

<p> </p>
<p><span style="\">Classic Developers, a destination that offers every one luxurious and fulfilling yet affordable lifestyle. It is one of the emerging real estate developers in the country having diverse range of activities in varied business domain. We are a certified company having large scale projects in progress.</span></p>
<p><span style="\"><br /></span></p>
<p><span style="\">Classic Developers with its dynamic professional work force and uncompromising attitude in terms of construction methodologies and quality control procedures, we offer you Efficient, Elegant and Economical place, which will be called your home, your happiness. We are here not only for a residential place but to fulfill your dream of having a home with modern day comfort and soothing ambience. We not only offer modern structures with latest amenities but ensure all the valued customers with Earthquake resistant and VASTU compliant construction.</span></p>
<p> </p>
Run Code Online (Sandbox Code Playgroud)

我需要没有html标签和其他风格的值.只有我想要的是其中的文字.我可以用PHP检索它.

提前致谢.

Ben*_*rth 7

http://php.net/manual/en/function.strip-tags.php

从数据库获得它之后,在它回显之前在其上运行此函数:

$content = strip_tags($content);
Run Code Online (Sandbox Code Playgroud)

编辑

编辑问题是为了显示特殊字符而不是原始HTML.如果它是那种风​​格,试试这种方式:

$content = strip_tags(htmlspecialchars_decode($content));
Run Code Online (Sandbox Code Playgroud)