Archive for the ‘Snippets’ Category

Country from IP

Thursday, May 5th, 2011

I was working on a advert site for a buddy, and needed to get the traffic's country code. This retrieves data (JSON format) and decodes it to get the user's country. If json_decode works on your server, you can remove json_decoder function, and change $json_Co=json_decoder($getCo); to $json_Co=json_decode($getCo);

Tags: ,
Posted in Snippets | No Comments »

Types of loops (for, foreach, while)

Thursday, May 5th, 2011

Tags: ,
Posted in Snippets | No Comments »

runtime interface generator

Thursday, May 5th, 2011

If a class implements an interface from another package you might run into trouble if you do not include the interface in your package. This class allows you to reduce coupling by generating empty interfaces at runtime if necessary. The class will try to autoload the interface and if this is not possible it will generate it.

Tags: ,
Posted in Snippets | No Comments »

Date, time in Kyiv and Warsaw

Thursday, May 5th, 2011

It shows the date and the current time in Ukraine and Poland

Tags: ,
Posted in Snippets | No Comments »

Show time in Kyiv

Thursday, May 5th, 2011

Tags: ,
Posted in Snippets | No Comments »

Random AlphaNumeric String

Thursday, May 5th, 2011

Used to generate a random amount of random letters, uppercase, lowercase, and numbers. You can add more characters in the $chars array, separating with "," after each, with no "," at the end. Enjoy!

Tags: ,
Posted in Snippets | No Comments »

Repeat a string

Thursday, May 5th, 2011

Repeat a string

Tags: ,
Posted in Snippets | No Comments »

Redirection with header (advanced)

Thursday, May 5th, 2011

Tags: ,
Posted in Snippets | No Comments »

Redirection with header

Thursday, May 5th, 2011

This script shows how to redirect to a specific site.

Tags: ,
Posted in Snippets | No Comments »

If else

Thursday, May 5th, 2011

Tags: ,
Posted in Snippets | No Comments »