Clean Up User-Input & Convert Line-Breaks To BR-tags

A simple PHP function to clean up user input. It does following: converts & to &amp; converts < to &lt; converts > to &gt; converts “ to &quot; and converts line-breaks to <br /> [ad name=”Adsense – text only”] The Function: function clean($str) {     $str = preg_replace(’/&(?!#[0-9]+;)/s’, ‘&amp;’, $str);     $str = […]

Detecting Mobile Devices Accessing Your WordPress Site

Mobile web surfing is continuing to evolve on a larger scale. This is why detecting those users who are visiting your WordPress blog through a mobile device and redirecting them to a mobile version of your site is important.