user2420263
user2420263

Reputation: 177

return text from database without html code

I have a text in my database with html tags to make the direction from right to left. and I am looking for a way to get the text from the database without the html tags.

this is how my text looks in the database:

<span dir="rtl"> ما هي تقنية GPS؟</span > 

and I want to get it just like this:

ما هي تقنية GPS؟   

I am using this code to get the text:

<?php echo  $text_db; ?>      

Upvotes: 0

Views: 953

Answers (1)

darioguarascio
darioguarascio

Reputation: 1087

There are several ways to get rid of HTML structure from a string, the quickest you can use is strip_tags($string) - https://php.net/strip_tags

Upvotes: 2

Related Questions