Round number to nearest fraction with PHP
Sometimes when you are trying to code small functions you realize that some one must have done the same thing before and you realize that google is as usual your friend in need!
I was trying to compile a helper function to round a float to what ever nearest fraction i needed. I found numerous examples on how to do this best while googleing.
Problem with Zend Framework and MySQL Longtext and Longblob generating out of memory error
I have had a bug in one of my apps for quite some time now. Trying to find the problem codewize ended up being futile. The problem occurs when trying to fetch a LONGTEXT or LONGBLOB with Zend_db Mysqli resulting in an error message like this;
Fatal error: Out of memory (allocated 6029312) (tried to allocate 4294967294 bytes) in /Users/hussfelt/Sites/testproject/library/Zend/Db/Statement/Mysqli.php on line 209
Remove last character from string in PHP
After looking around for a way to actually remove the last character of my string even if it was not the last one in the string given, I came up with these two ways. I figure that the one using strrev() is a lot faster then the one using explode(), but as someone might want the first way, I publish it anyway.
