Category Archives: php

Enable FreeType and recompile PHP on Linux

FreeType library is typically required along with GD library in PHP. This will enable usage of imagettftext() and other functions. Install FreeType Install FreeType library first at OS level. # yum install freetype-devel You have to add the installed path to the PHP configure command.. FreeType will be installed in /usr/include/freetype2 on RHEL. find / -name freetype Enable FreeType in PHP You have to get the configure command first. Use php -i | grep “Configure” command and get the configure command. It will be something like this. ./configure  –prefix=/usr/local/php7 –with-mysqli=/usr/bin/mysql_config…

Read More »

Number to words in php

NumbWordter is a number to word converter class written in php. This class will be useful to display numbers as words. Usage: $converter=new NumbWordter(); echo $converter->convert(1823912); // echoes – One million, eight hundred and twenty three thousand, nine hundred and twelve Remember these..  The class uses “million” terminology to name the number. [Thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, unidecillion, duodecillion, tredecillion and quattuordecillion] If no number is passed, there will be no output.  The length of number passed, should be maximum…

Read More »