ctype_alnum($testcase);
MySQL UTC timestamp
You can insert the UTC timestamp manually as follows…
INSERT INTO table_name (utc_timestamp)
VALUES (UTC_TIMESTAMP())
Alternatively you can set the timestamp per session using…
SET @@session.time_zone='+00:00';
..or per server (my.cnf)…
[mysqld]
default_time_zone='+00:00'
PHP & how to trim, replace tabs and extra spaces with single spaces
$data = preg_replace('/[ ]{2,}|[\t]/', ' ', trim($data));
PHP & how to trim white space on beginning and the end of each new line with
$text = join("\n", array_map("trim", explode("\n", $text)));
PHP easiest color swap for rows
<style>
.odd{background-color:red;}
</style>
$c = true;
foreach($posts as $post) echo '<div'.(($c = !$c)?' class="odd"':'').">$post</div>";
Source: https://stackoverflow.com/questions/399137/easiest-way-to-alternate-row-colors-in-php-html