I am not that good with PHP and have a question for you. I use text area which is tied up to a javascript text editor (turns the text area into simple text editor) and for example I type :

1. Course one
2. Course 2
Then it will save it to database and another page pulls those information to display it but when it displays it look like this:

<ol><li>course one</li><li>course 2<br></li></ol><br>

How can I for mat it to shows it without the html elements but still keeps the formatting?

I tried many suggestions but no luck at all, strip_tag etc…

Here is the code for the page:

foreach ($db_handle->query("SELECT * from assignments WHERE courseID='$courseID' AND weeknum='$weekcount' ORDER BY duedayfactor ASC") as $row){
	$baseAssignDate = $startdate + $row['duedayfactor'];
	$assignDate = date("l n/d/Y",$baseAssignDate);
if($row['displaydate']!= "nodate"){
	echo "<b>". $row['displaydate'] . " " . $assignDate . "</b><br>";}
	echo $row['descrip'] . "<br>";

	echo "</td></tr>";

I tried many tags but nothing works, everything I tried strips the formatting and gives me the text only which is not what I am looking for.

Edited by ak1200: n/a

6 Years
Discussion Span
Last Post by chrishea

If what you want to do is to show it formatted (interpreting all of the HTML tags rather than showing them with the text) then you need to display what is in the db as an html page. Simplistically, read what's in the db and echo it to the screen.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.