Scooter Daraf Scooter Daraf - 4 months ago 12
PHP Question

Get clickable anchor from database inside div

I have text field in database stored like that :

I like my <a href='www.website.com'>Website</a>


So my variable is:

$text = "I like my <a href='www.website.com'>Website</a> ";


and when i fetch it i get it like that

I like my <a href='www.website.com'>Website</a>


How can i get it clickable like that ? thanks


I like my Website

Answer

You need to echo your text

echo $text;

If you receive encoded text, than use some decoding:

echo html_entity_decode($text);
Comments