and like us on FB The CMYK color model is a subtractive color model used in color press printing. CMYK refers to the four inks used in some color printing: cyan, magenta, yellow, and key (black). In additive color models such as RGB (used in computer monitors, for example), white is the “additive” combination of all primary colored lights, while black is the absence of light. In the CMYK model, it is the opposite: inked (white) paper absorbs or reflectsRead More
Finding the root domain name (or a top level domain, TLD) from a URL is challenging. Literature on the web generally leans towards a library that’ll find the root domain by way of comparing the URL against all approved top level domains … but this method introduces a degree of complexity that we wanted to avoid. The following function is one that we use to find a domain name root. It isn’t perfect, but it’s close.
and like us on FB The large number of string, random, and hashing functions make it easy to generate a random string with PHP. This article, partially migrated from Internoetics, will look at just a couple ways of achieving a random string from a pool of characters, with of a defined length. Generally speaking, increasing the length of a string and character count makes the string (or password) more secure. beliefmedia_random_string() The first example takes a user-defined string of permittedRead More
and like us on FB The CIE XYZ color model (created in 1931) is a ‘device-independent’ colour space in which each primary colour (X,Y,Z) is always constant, unlike RGB model where color variances occur with every individual device that applies the model (monitors, scanners, cameras, etc.). The CIE XYZ color space encompasses all color sensations that an average person can experience. As such, the model serves as a standard reference against which many other color spaces are defined. The PHPRead More
and like us on FB The RGB model of visualising color can be problematic on the web because of the nature in which the values are mixed. Not unlike mixing paints from individual tins, we would have to alter all the quantity of all paints to achieve our desired result. For example, if we have an orange with RGB values of R217 G118 B33 and want to reduce its colourfulness by half to a less saturated orange, we would needRead More
On a member-based site we operate we put a limit on the size of a directory before additional credit is required. The following function will recursively look through an entire directory and return a filesize. While the value returned is in bytes, you can alter it into a human readable string by using the first function from this article (“Return a Readable Filesize with PHP”).
If you find yourself with the need to re-index an array so the first element has a key of 1 (rather than 0), the following function may come in useful. The function certainly isn’t required… it’s just that we were repeatedly applying the code in a project, so it made sense.
and like us on FB The PHP functions on this page will permit you to convert hexadecimal values to their RGB value, or vice versa. Both the Hexadecimal and RGB values have very clear patters in how they’re manufactured. About Hex and RGB Values The RGB colour model is a model in which red, green, and blue light are added together in various ways to reproduce a broad array of colours. The RGB name comes from the first letter ofRead More
and like us on FB PHP’s function will do as described: get the size of a file in bytes. However, it’s usually necessary to convert that returned value into something more readable, and the PHP functions in this article will accomplish that. The first function will take a value in bytes and return a human readable string. The B for bytes, K for kilobytes, M for megabytes, etc will be appended, and the decimal value will be truncated to yourRead More
and like us on FB A time server is a computer server that reads the precise time from a reference and distributes this information to various clients. The most widely used for distributing and synchronising time over the Internet is the Network Time Protocol (NTP), though other less-popular or outdated time protocols continue to be in use. Your time can be synced to any number of for the purpose of updating your own system time or querying it for anotherRead More