PHP Array of Reserved Usernames

Here is a list of reserved usernames found on this page. I conveniently spent the 15 minutes and put them in a PHP array for you. You’re welcome!

PHP Function: Get the YouTube Video Id from a YouTube URL

Here is how you can get the YouTube Video ID from a URL no matter how many extra parameters get passed along with it. function getYouTubeIdFromURL($url) { $url_string = parse_url($url, PHP_URL_QUERY); parse_str($url_string, $args); return isset($args[‘v’])…

View →

Highlight Unicode Text in PHP

I was trying to get my old highlight function to highlight Russian text from a MySQL database. No Go. It was using eregi_replace which is deprecated according to the php manual. I ended up getting…

View →

PHP Function: Pagination

Here is my function for pagination: function createPagination($pageLink,$page,$total_pages) { if($page > $total_pages || $total_pages == 1) { return “”; } echo “<div class=”pagination”>n”; if($page != 1) { echo “<span class=’nc’><a href=””.$pageLink.($page – 1).””>< previous</a></span> &nbsp;…

View →

PHP Function: Search Engine Friendly URLs

Here is the function I have been using to make friendly url strings. The second param is your spacer. function makeURLFriendly($string,$spacer = “-“) { $newstring = strtolower($string); $newstring = preg_replace(‘/[^a-zA-Zds]+/s’, ”, $newstring); $newstring = preg_replace(‘/ss+/’,…

View →