Code Samples

PHP: Connect to MySQLi database

Simple PHP function to establish a MySQLi database connection

PHP: Resize image to specified height

PHP function to resize an image to a specified height. The width is scaled proportionately.

PHP: Resize image to specified width

PHP function to resize an image to a specified width. The height is scaled proportionately.

PHP: Truncate string after last word in range

PHP function to truncate a string after the last word that appears within your specified range.

PHP: Truncate string after n words

PHP function to truncate a string after a specified number of words.