Handling Links

This is some code that I cooked up for handling links in my website. I was tired of prefacing every link with “”. This takes care of that and ensures that it will open in a new window. Easy as pie. I’m sure there is probably a better way to do it, but this is the way I figured out how to do it.

function redirect ($url)
$url = preg_replace(“#Note: This was code that I originally had in a ‘Code’ page, but I’m moving it to a post now. This code is probably really old (years and years old). I enjoy laughing at myself and so should you.

Leave a Reply

Your email address will not be published. Required fields are marked *