Geekpedia Programming Tutorials









Tutorials and Code PHP Tutorials and Code

1 2 3 4
(48 tutorials and code in 4 pages)
Latest Tutorials: RSS Feed RSS Feed     KlipFolio Klip Klip     Add to Google    Add to My Yahoo!    Subscribe in NewsGator Online    Add To Windows Live    Subscribe with Bloglines   
Latest Code: RSS Feed RSS Feed     KlipFolio Klip Klip     Add to Google    Add to My Yahoo!    Subscribe in NewsGator Online    Add To Windows Live    Subscribe with Bloglines   
Tutorial

****-
4.08 from 12 votes

Mar 13th 2004
by Andrew Pociu

Alternating row colors

Alternating row colors is a very good way to make big tables more ergonomic and esthetic. Script and explanation here. Also explains the modulus operator.

Code

*****
5 from 1 votes

Nov 17th 2007
by Andrew Pociu

Redirect using PHP

A function that redirects the user to the specified URL by sending the appropriate headers or by using JavaScript if the headers were already sent.

Code

***--
2.67 from 3 votes

Nov 11th 2007
by Andrew Pociu

Check if a string ends with another string

A short function that checks whether a passed string ends with another passed string, and returns the answer as a boolean value.

Code

*****
4.57 from 7 votes

Nov 3rd 2007
by Andrew Pociu

Detect operating system from user agent string

This code uses an array of user strings and their matching operating systems so that it can detect what operatings system the user is using.

Code

-----
No votes

Nov 3rd 2007
by Andrew Pociu

Write a string to a file

This example shows you how to write a string to a file using PHP, and also do some error handling to ensure that your file gets written correctly.

Code

*----
1 from 1 votes

Oct 13th 2007
by Andrew Pociu

Calculate the age in years using PHP

A PHP CalculateAge() function created by applying the logic we used previously in C# to calculate the age from a given birth date.

Code

****-
3.67 from 3 votes

Oct 13th 2007
by Andrew Pociu

List the content of a directory/folder using PHP

With a few lines of code and a while loop you can list the content of a directory on both Unix and Windows machines.

Code

*****
5 from 1 votes

Oct 5th 2007
by Andrew Pociu

Check if VIN number is valid

Complex PHP code for checking the validity of VINs (vehicle identification numbers). It also returns the check digit of each VIN number.

Code

-----
No votes

Oct 2nd 2007
by Andrew Pociu

Find out where a TinyUrl.com url points to

This PHP source code uses sockets to retrieve the URL that TinyUrl.com points to, without you having to actually access the URL.

Code

-----
No votes

Sep 30th 2007
by Andrew Pociu

Basic file based hit counter

Very basic hit counter based on a plain text file, built using PHP.

Code

-----
No votes

Sep 27th 2007
by Andrew Pociu

Validate email addresses using PHP

This PHP function validates an email address without using RegEx. It's not the most comprehensive function however, as it doesn't check for special characters that are not allowed in an email address.

Code

*****
5 from 2 votes

Sep 27th 2007
by Andrew Pociu

WhoIs function for domain-name info

This function returns the WhoIs string for the passed domain name (such as the domain-name owner and nameservers) by opening a socket to a WhoIs server.

Code

*----
1 from 1 votes

Sep 26th 2007
by Andrew Pociu

Check for prime numbers

The IsPrime() function uses the recursive method to check if a number is prime. It's a fast function which can compute thousands of numbers within seconds.

Code

-----
No votes

Sep 25th 2007
by Andrew Pociu

Forcing downloads with PHP

The DownloadFile() function will initiate a download from the path that you provided. It works great with large files because it buffers the data, instead of putting the entire content of the file in memory and serving it from there.

Code

*----
1 from 1 votes

Sep 21st 2007
by Andrew Pociu

Generate random password of various strength

This function is a smart password generator, as it allows you to define the length and strength of the password. It also avoids characters that can easily be confused with digits such as lowercase 'l' and 'o'.

Code

-----
No votes

Sep 20th 2007
by Andrew Pociu

A function that formats date and time

The ConvertDateTime() function takes a date and time string in the typical MySQL format (YYYY-MM-DD HH:MM:SS) and formats it as instructed by the formatting string.

Code

-----
No votes

Sep 12th 2007
by Andrew Pociu

Get the file extension

This function will extract the file extension from a string that represents a filename. It retrieves the characters after the last dot and returns them as a new string.

Code

*****
5 from 1 votes

Sep 11th 2007
by Andrew Pociu

Stripping string of URL unsafe characters

A function that will strip all the unsafe characters from a string in order to make it valid for URLs. This can be especially useful when you create your own URLs dynamically using mod_rewrite.

1 2 3 4
(48 tutorials and code in 4 pages)
Filter Results
Show:


Latest IT Jobs


Other Resources
Latest Tech Bargains

Advertisement

Free Magazine Subscriptions

Today's Pictures

Today's Video

Other Resources

Latest Downloads

Latest Icons