PHP Convert mm into Feet and Inches

I had to write a little bit of PHP to convert mm into feet and inches. $mm_value = 2590.00; $convert_to_metres = floor($mm_value) / 1000; $convert_to_inches = $convert_to_metres * 39.3701; $feet_value = floor( $convert_to_inches / 12 ); $inches_value = ( $convert_to_inches % 12 ); print $feet_value . '\' ' . $inches_value . '"'; Should give you 8’ 5” ;) »

Drupal Getlocation Multiple Marker Select List Workaround

I had recently been asked to implement a custom Google Map for a client in which there would be multiple markers for different locations, but also a select list of all the locations that the user can click on and the map in turn would focus on. Now in my workplace, we use the Drupal GetLocation module to deal with any Google Maps on the sites. I did some some digging around, messing with views and (a lot) of searching on online and I couldn’t figure out a way, via GetLocations, to achieve this. »

PHP Adjust Colour Brightness

If you just want the function and don’t want to read the rubbish of why I used it then see below my good chum… Use Case I have recently been working on a template built on Drupal, which allows the user to select their own colours using the color module. One feature within the design is to have certain elements that would have a background/border colour that contrasts the background colour select by the user. »

Drupal Clean CSS Class

A small function which has become a bit of a regular use is Drupal’s Clean CSS Identifier. “Prepares a string for use as a CSS identifier (element, class, or ID name).” drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')); This has become very handy in situations. »