PHP Replace special characters before MySQL insertion

If you are working with MySQL database (UTF-8) and handle input that is being copied from other sources- you may run into issues with special characters such as ellipses, long dashes, and special quotes.

Inserting these characters without addressing them can lead to nasty results later on, like this: 


Here is a useful function that replaces the most common special characters with their UTF equivalents

Share

PHP Make URL into Hyperlink

I needed a PHP function that would convert URL’s echo’d from MySQL into clickable links. The best function I could find comes from WordPress code, and works beautifully on its own. Additionally supports e-mail and FTP.

Share