This function will take an image and create a thumbnail.
This function takes a name, and creates initials, such as "Billy Bob" to "B.B."
This function will calculate the difference in length between two strings.
A simple tutorial of how to connect to a database.
This Snippet will check and see if if a user is logged in or not.
Take a valid string URL with get variables, so they can be accessed using php's P\predefined GET variables or just return an array
This function will check a string to see if it contains any HTML in it.
Creates a thumbnail image when a photo is uploaded to your site.
This function will check any number to see if it is a prime number or not!
Tries to make out of the given string a xhtml-compatible string, that means that the return-string could be wrapped within a xml.
Countries of the European Union add an hour to the time during summer to better seize sunlight, so for several months GMT 0 becomes GMT +1, GMT+1 becomes GMT-2 and so on. This is known as Central European Summer Time (CEST). This script takes a Unix timestamp and adds an hour to it (3600 seconds) if we are in this summer period.
This is based on php's isset() function. So instead of doing like this if (($var1 != "") && ($var2 != "") && ($var3 != "") && ($var4 != "")) we can use if (!empty_str($var1,$var2,$var3,$var4))
A easy way to create simple INSERT / UPDATE query's to MySql In the scrip change the value for $url, $dbuser and $pwrd
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);
Count the words typed using exlpode function
Simple Country list generator (Optin list or Unordered list)
Stops PHP from sending a fresh version of an image if the browser already has it in its cache.
checks the week day of my birthday depending on the year I specify
Generate a file cache, this is usually good for your database especially on content that doesn't change often.
I, jarno, wil teach you how to inplement my cms in your website. Questions: replie to this snippet Sorry for my bat englishbut i'm a belgian and i'm just fourteen years old
Converts the NASA SRTM-Data in .hgt-Format to ASCII .csv in the Format lat;lon;ele for easier import into databases. All .hgt-files are expected to be in a subdirectory relative to the script named "hgt". Save as converthgt.php, then run in console / command line: php converthgt.php > srtm.csv This will produce a large csv-file from all the .hgt-files in the hgt-subdirectory. The data is grouped by filename with a two-line grouping header.
Function that creates the options for a selection list of countries. Takes input of selected country and sets the option to selected. If nothing else, this should save others a bunch of typing and copy&paste.
This is a css "compiler" and minifier to make styling better for performance and simplify the linking stylesheets. If you ever had a project where you had to use a lots of css files to use in order of team work or just for particular styling, you know what I'm talkin about. I hope it will be useful. Enjoy, use or even develop it to be more efficient. If you feel you made nice changes on it, that could be make it more efficient please contact me. *THIS SNIPPET HAS A VERSION FOR LESS!! IF YOU WOULD LIKE TO USE IT PLEASE CONTACT ME TOO! * :)
The scope of this function is to validate given value. It returns true if the value is non-zero positive integer value and false otherwise. Checking is_bool is required because if we remove is_bool checking and pass true to function that it returns true which is against the expected behaviour.I have mentioned few test-cases that i have tested. I would love to have your feedback on this.
scope of is_https is to check whether HTTPS is used or not
scope of isAjax function is to check whether request is done via ajax or not.
Scope of isSharedInternet function is to determine whether client is using shared internet or not.
Scope of isProxy is to determine whether client is under Proxy or not.
This is I think a cleaner way to handle generating a list of selection options. The only thing that needs to be done to add or remove a country is to modify the countries array.