Generating a random color with PHP

Hi there, today I’m going to give you a quick snippet that will maybe help you in your future or current projects in PHP.You could use multiple methods on generating random HTML color codes with PHP, but today I’m going to teach you 2 ways of doing it.First one is this:

and the second […]

PHP Ip to country script

Hi there guys, today I’m going to give you a quick function that is very useful to determine what country does an ip has.

This is a function that works for both IP’s and domain names.This function is using a free API called wipmania, whenever this API is down or it doesn’t locate the […]

PHP Check if port is opened

Hi there, I know I haven’t posted so much later but I got something for you today.A little php snippet that will help you check if a specific port is opened on a specific IP or domain.Here you go, made this specially for you guys, hope this will help you somehow.

Get execution time of the script PHP

Today I’m going to give you a very useful snippet that you can use in your further projects to see the execution time of the script.The principle is pretty simple.You will need to define a variable at the start microtime() and one at the end.After that you will need to subtract the end microtime variable […]

How to easily read lines from a text file with PHP

Today I’m going to give you a very quick and simple php snippet or function which reads every line of a .txt file and returns them into an array.For example, you have this text file called countries.txt with the following content: Romania Russia Germany Bulgaria You can read them very easily with PHP with an integrated function called […]

Block multiple IP addresses with PHP

Today I’m going to give you a quick and very useful snipped on how to block multiple IP addresses with PHP. First off you will have to implement this custom function in your code, preffered in the file that initializes the script.

After that, you need to define an array which contains the ip’s […]