Tag: PHP

  • PHP + Recursion + loop + global array = trouble

    Once again, I came across an issue that I racked my brain about for hours, if not days: I had written a recursive function in PHP that should run through a globally declared array with a foreach loop and then restart itself if necessary. Everything ran perfectly well – but only on my local server.…

  • Preserve PNG transparency with GD Lib

    Lately I had to write a PHP function that generates differently sized thumbnails from an image with GD Lib. Thereby I had lots of trouble with semi-transparent PNG graphics. Although I found many tips on the internet that pointed me in the right direction, I couldn’t find a really complete and neat solution. Many people…

  • Strange error message in Poedit

    I’m currently working on a PHP project that needs to offer possibilities of internationalization, i.e. the application should be translatable into any language with minimal effort. Since I had already come to know the mechanics of gettext from WordPress and was highly enthralled by its simpleness and effectivity, I decided to use this system for…

  • Live Ajax PHP regex tester

    Yesterday I was close to a nervous breakdown, because my beloved PHP regex tester, formerly to be found at http://nancywalshee03.freehostia.com/, doesn’t exist any more. So I shorthand created another gem of dirty programming work and wrote a new one quickly, to be found at http://www.ginchen.de/regextester/. It uses preg_match_all() to find the needle in the haystack…