Regular Expressions: Remove Links Hashes & Mentions from Tweet

Use this regular expresion to remove URLs (http://…) hashes (#ahash) and mentions (@amention) from Tweets or any other block of text for that matter. For PHP code use: /(@|#|http\:\/\/)([a-zA-z0-9\.\/])+/   For JavaScript: ^(@|#|http\:\/\/)([a-zA-z0-9\.\/])+$    

JSON: Tweets from Multiple Twitter Users

Use the following JSON URL to access tweets from multiple twitter users. Of course, you can parse this JSON response using JQuery, PHP or any other language to display these tweets however you want.

Changing “upload_max_filesize” in php.ini on GoDaddy Shared Hosting

Changing upload_max_filesize on GoDaddy Are you running your website on a GoDaddy shared hosting plan? Are trying to upload a file using a PHP script and you can’t get it to upload files larger than 8 MB? Do you want to change the maximum allowed file size for uploads? If this is the case, I […]

Open PHP as a Text File Using .htacess

Place this code in the .htaccess file to disable processing of PHP files in a folder. This will remove the PHP handlers in Apache forcing the browser to load the PHP file as a text file. You can use this to secure folders where upload is allowed to prevent executing uploaded PHP files. RemoveHandler .php .phtml .php3 […]

Commenting HTML, CSS, PHP, Javascript, SQL & ASP

Use the tags below to enter comments or notes in your HTML, CSS, PHP, JavaScript or ASP code: Language Single/Multi-Line Start with End with Example HTML Single & Multi-Line <!– –> <!– This is an HTML Comment –> PHP Single Line // // This is a PHP Comment PHP Mutli-Line /* */ /* This is […]

PHP: Country Name from IP Address

Here’s a PHP script that demonstrates an easy way to get a country name or code from IP address using pure PHP. Included in the file: GeoIP.dat: a binary databases of countries and IPs maintained by The database is updated monthly and has a 99.5% accuracy rate. You can always get the latest version here. […]