-5

halo everyone. maybe this is the simple question but believe me. i already google it but still doesnt work. i use PHP code for this.

do i can really hide the html elements?

let say that i have database that keep every html elements like this

<b>Good Morning!</b> Nice to meet you!

but when i echo it

echo "<b>Good Morning!</b> Nice to meet you!";

The results looks like this:

Good Morning! Nice to meet you!

but i need the result like this

Good Morning! Nice to meet you!

so all the elements when display is gone. just the original words.. do this can be happen?

MrTux
  • 32,350
  • 30
  • 109
  • 146
tjandra
  • 85
  • 1
  • 2
  • 7
  • *i need the result like this* what do you mean "results"? A browser will display the results like this. Your question is not clear – Liam Oct 11 '18 at 11:50
  • Possible duplicate of [Strip HTML from Text JavaScript](https://stackoverflow.com/questions/822452/strip-html-from-text-javascript) (Assuming you are using JavaScript) – Maor Refaeli Oct 11 '18 at 11:50
  • 1
    @MaorRefaeli the thing is `echo` isn't a Javascript command so I'm not sure that dupe is right – Liam Oct 11 '18 at 11:51
  • 1
    Suppose you use php, then ckeck out this: https://www.w3schools.com/php/func_string_strip_tags.asp – MrTux Oct 11 '18 at 11:51
  • Just pick a language and google it... i.e. python https://stackoverflow.com/questions/753052/strip-html-from-strings-in-python – Maor Refaeli Oct 11 '18 at 11:53
  • Do you want the bold effect? – DoobyScooby Oct 11 '18 at 11:54
  • Striping HTML tag is not a new thing. You can achieve it every language. You did not mention where you want the text to be displayed so it can on client side, server side, some script or if you want to work harder do it in bash – Maor Refaeli Oct 11 '18 at 11:56
  • php tag wasn't mentioned before.. its duplicate https://stackoverflow.com/questions/14684077/remove-all-html-tags-from-php-string – Maor Refaeli Oct 11 '18 at 11:58
  • @MrTux Let me fix your link [w3 no good](http://php.net/manual/en/function.strip-tags.php) –  Oct 11 '18 at 11:59
  • you can easy google this question – Metatron5 Oct 11 '18 at 12:13

1 Answers1

0
echo strip_tags("<b>Good Morning!</b> Nice to meet you!");
DoobyScooby
  • 367
  • 3
  • 6
  • 17