Contact Details
| Phone | +44(0)113 2500370 |
| info@hydrotecltd.co.uk | |
| Address |
Hydrotec Consultants Ltd Moorfield Close Moorfield Estate Leeds LS19 7YA |
Map & Directions
Send us a message
/** * Returns the first portion of a string, nicely trimmed to finish on a whole word or sentence etc. An indicator can be specified such as * '...' which would be added to the string if it was shortened. * * @param string $string The string which you would like to return a snippet of * @paran int $max_length The maximum number of characters to return a snippet of (not including the $indicator) * @param string $indicator Additional characters to append to the string if it is shortened (eg '...') [optional] * @param string $search_char The character to search for the last occurance of (eg ' ' to end on a whole word [optional] * * @return string Returns the snippet of the string with additional indicator if the string was trimmed and * one was specified */ function snippet($string, $max_length, $indicator=' ', $search_char=' ') { if(strlen($string)>$max_length) { return substr($string,0,strrpos(substr($string,0,$max_length),' ')).$indicator; } else { return $string; } } ?>
| Phone | +44(0)113 2500370 |
| info@hydrotecltd.co.uk | |
| Address |
Hydrotec Consultants Ltd Moorfield Close Moorfield Estate Leeds LS19 7YA |