From array to HTML table - very simple
This is a very simple function to create a HTML table from an array. Some things are even hardcoded but can easily be either changed or modified to be more generic.
This is a very simple function to create a HTML table from an array. Some things are even hardcoded but can easily be either changed or modified to be more generic.
By including the Simple HTML Dom library you can extract any HTML element and get their attributes. This is how to get the charset from the meta tag element. The function _get_html_charset() will return "utf-8".
This function removes all HTML and keeps the plain text and is an enhancement of PHP strip_tags() function by strip out styles, scripts, embedded objects, and other unwanted page code.
When you do stack charts, it is important that the colors differ so much from each other that they are not mixed up. I made a function that returns a predetermined number of color codes that I've tested that is not too similar to each other.
When these color codes ends, a random number generator creates new color codes, these are not controlled, but my tests shows that it will do well.
Maybe I am doing a new feature one day that randomly generates an indefinite series of colors that can lie next to each other without being mixed up.
Writing an RSS feed based on HTML can cause some trouble using htmlentities though it converts too much, use htmlspecialchars instead.
First: The utf8_function function converts from ISO 8859-1 to UTF-8. So you only need this function, if your input encoding/charset is ISO 8859-1. But why don’t you use UTF-8 in the first place?
Second: You don’t need htmlentities. You just need htmlspecialchars to replace the special characters by character references. htmlentities would replace “too much
Trying to hide and show a table by JavaScript. Something is disturbing td in table when using style="display: block;" on table. (Using FF)
The with of the td loses the reference to the tables 100% and reference to its own content. But using display="block" works fine. The solution is to use a div with style="display: block;" around the table.
Some HTML entities: