This function will check to see if the file your checking is an image.
This basic snippet will create a random authentication code, or just a random string.
Code choose 6 numbers between 1 and 42 , sort them and choose a reserve number between 1 and 42 , then display it in the browser.
Allows you to easily keep track of a series of items as either odd or even. Each time you check (using the "which" method) the counter increments so that the next time you check the state will have changed. This is the perfect class for using when you're outputting an HTML table and want to use different classes to differentiate between odd and even rows. Simply create a new instance and call OddEven->which() for each row!
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.
This is a more advanced email verification.
This class will take a movie and convert it to an ascii movie (FFMpeg required). Note, output files are about 10x larger than the actual movie, but it is a really cool effect!
Takes a string of numbers and formats it into a Social Security number format. Example: formatSSN('123456789'); //returns "123-45-6789"
This snippet uses cURL to get a graphic and display a thumbnail image on the page without saving it.
search text with format "@format" and convert it to link
Tries to make out of the given string a xhtml-compatible string, that means that the return-string could be wrapped within a xml.
Convert Fahrenheit to Celsius and vise versa.
Very common, people wanting to perform an action on many items. This will perform the action of deleting many files.
This checks to see if two strings match each other.
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.
Using a string of text, find out how many kilobytes or bytes the string would and/or will take up in a file if it gets saved.
It shows the date and the current time in Ukraine and Poland
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.