Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

html to regular text using php function

convert

<br>
<p>hi how are you<p>
<b>bold</b>


into regular text

using a php function
Avatar of Dushan Silva
Dushan Silva
Flag of Australia image

<?php
echo"<br>";
echo "<p>hi how are you<p>";
echo "<b>bold</b>";
?>
Avatar of DoCBReeD
DoCBReeD

Sorry earlier I miss understood the question, that you code to convert html2php , later I identified you want html2text.

http://sb2.info/php-script-html-plain-text-convert/
http://www.tipsntutorials.com/tips/PHP/41
Avatar of Ovid Burke
Try this:

<?php
$str_html = '<br>
<p>hi how are you<p>
<b>bold</b>';

echo strip_tags($str_html);
?>

Open in new window

forever strip_tags() !
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

thanks
Avatar of rgb192

ASKER

I have a similar more complex question that involves entering any html into a database and the database being able to save muliptle lines without using html

https://www.experts-exchange.com/questions/26852658/no-html-tags.html
Avatar of rgb192

ASKER

Disregard previous


I want to do this with a more complex h1 tag

https://www.experts-exchange.com/questions/26862770/convert-html-into-regular-text.html