Here, you’ll find chunks of PHP, MySQL, HTML, jQuery, JavaScript, and Ajax code that we’ve put together while working through various projects. Hopefully they’ll help you out in your coding adventures too. Displaying posts 26 through 50 of 89:

TSV File to PHP Array

PHP
This function lets you take a tab separated text file (or comma separated, pipe separated, etc.) and convert it into a PHP array with just one line of code. Huge time saver. » View Post

Import MySQL Queries from a File Too Big for phpMyAdmin

MySQL | PHP
This PHP script will process queries exported by phpMyAdmin (or any other source) from a file that exceeds your maximum file upload size. » View Post

Convert IPv6 Address to IP Number with PHP

PHP
Quick and easy function converts both IPv4 and IPv6 addresses to IP numbers. No PHP extensions required. » View Post

Use JavaScript to Determine Vistor's Version of Internet Explorer

JavaScript
This function lets you see if someone is using IE and, if so, which major version. It's helpful for blocking access to pages that are known to fail in older versions of the browser. » View Post

Display an Unsupported Browser Warning with CSS

CSS | HTML
This example shows how to display an unsupported browser message to users simply and easily. No JavaScript needed. » View Post

Do Smart Quotes Hurt SEO?

SEO
I used to think yes, but recent evidence suggests otherwise. » View Post

Get Timezone by Latitude and Longitude in PHP

cURL | Maps | PHP
This function lets you quickly go from lat. and long. coordinates to a time zone by connecting to the GeoNames web service. » View Post

Countries, States, Provinces, and Oceans MySQL Dump

Data Dumps | MySQL
A MySQL data dump of tables containing all countries, U.S. states, Canadian provinces, Mexican states, and oceans. » View Post

Convert State and Country Abbreviations to Names Function

MySQL | PHP
This PHP function makes it super easy and quick to go from an abbreviation to a full state or country name. We include the MySQL data tables you need too. » View Post

A Fix for When FileZilla Gets Stuck Beyond Your Mac Screen

FileZilla | Mac OS
What to do when FileZilla gets stuck up above the top of the screen on your Mac. » View Post

All Countries MySQL Database Table

Data Dumps | MySQL
A data dump of the world's countries in MySQL format. Includes names, 2-digit abbreviations, and 3-digit abbreviations. » View Post

Display List in PHP with Commas and "And"

PHP
Like PHP's built-in implode function, but with extra logic to give an "and" before the last item in the list. » View Post

Get Image Coordinates With jQuery

Images | JavaScript | jQuery
This code lets you grab the X,Y coordinates of any point of any image using jQuery and JavaScript. It can be useful for allowing users to crop their own images, tag friends in photos, or other similar applications. » View Post

Crop Images With CSS

CSS | HTML | Images
Here's a shortcut that will let you "crop" images when you display them without having to actually modify the image files. » View Post

Get Facebook app_scoped_user_id From Facebook ID

Facebook | PHP
A little help transitioning to version 2 of the Facebook Graph API. Explains how to get the app_scoped_user_id values for your users if all you have is their original Facebook ID. » View Post

Basic PHP cURL Example

cURL | PHP
A quick example showing how to retrieve a webpage's contents remotely. » View Post

Generate CSV From PHP Array

PHP
Basically the opposite of fgetcsv, this function takes a PHP array and converts it into a CSV file for you. » View Post

Display PHP Array as Table

PHP
This function lets takes a one-dimensional PHP array and turns it into a nicely formatted HTML table for display on your page. » View Post

Display PHP Array as a Google Chart

PHP
This function makes it super easy to go from a PHP array to the JavaScript you need to generate a Google BarChart, AreaChart, GeoChart, LineChart, PieChart, and more. » View Post

Custom Error Handling Function

PHP
This PHP function prints a nicely formatted error message out to the screen and ends the script. » View Post

CSV to Array PHP Function

PHP
This time-saving function lets you go from CSV file to PHP array with just one line of code. Very simple and easy to use. » View Post

Tint Images with PHP

Images | PHP
Take a black & white image and tint it red, blue, green, or any other color that you can dream up using PHP and its built in image library. » View Post

PHP Functions to Calculate Interest Payments

PHP
These functions let you easily determine how much of your monthly mortgage or car payment is interest compared to principal. Both daily compounded and monthly. » View Post

Assigning a Virtual Domain Name to Your Localhost

Apache | OSX | Windows
Here's how to access your pages via something like http://intranet/ over your local network using Apache and a slightly modified local hosts file. » View Post

Add Social Media Buttons without JavaScript

Facebook | Google+ | PHP | Pinterest | Twitter
Let your users share your content on Facebook, Twitter, Google+, and Pinterest without having to depend on JavaScript. » View Post
» First · Previous · Next · End · Categories