MaggsWeb:7

www.maggsweb.com

Posts Tagged ‘ function ’

trimtext with display

July 23, 2007 | Comments | PHP

Text too long…? Not wrapping, or pushing other elements around…? I wrote this little function to trim text to any length, adding ‘…’ at the end if trimmed. Then, it displays the full text as you hover over it. Cooool!

[More]

imageResize (inline)

May 23, 2007 | Comments | PHP

Can’t rely on the size of an uploaded image and don’t want to resize it?

This function takes the larger size of the width and height and applies a formula accordingly. Then gets the new value and applies the percentage, then rounds the value. It returns the new sizes in html image tag format so that you can plug this function inside an image tag.

[More]

This handy little script can be used as a function as required, or in an include. I have used this on virtually every site that uses a a database connection.

[More]