Round number to nearest fraction with PHP

E-mail

Blog - PHP

Wednesday, 10 March 2010 Last Updated ( Wednesday, 10 March 2010 00:04 )

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.

Read more: Round number to nearest fraction with PHP

 

Problem with Zend Framework and MySQL Longtext and Longblob generating out of memory error

E-mail

Blog - PHP

Wednesday, 10 March 2010 Last Updated ( Wednesday, 10 March 2010 00:04 )

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

Read more: Problem with Zend Framework and MySQL Longtext and Longblob generating out of memory error

 

Remove last character from string in PHP

E-mail

Blog - PHP

Wednesday, 10 March 2010 Last Updated ( Wednesday, 10 March 2010 00:04 )

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.

Read more: Remove last character from string in PHP

 

Like this Joomla template?

As many other things on this site it is completely free! In collaboration with Midsjö AB are we releasing it into the public domain under the GNU/GPL version 2 license. You will find this template and other extensions under the Labs section then Joomla!. Good luck and happy Joomling!