mthorn


Member since 08/08/2006

5 snippets

4527 profile views

0 Comment(s) Posted

View their favorites

Profile

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

mthorn's Recent PHP Snippets



« Prev 1 Next »
Took 0.164692 seconds for array[] Took 0.395778 seconds for array_push As you can see array_push is more than twice as slow. Here are the reasons. Array_push is a function call, Function calls are always slower. Array_push takes mixed parameters,...
0 3078 posted 17 years ago by mthorn
strcmp with matching strings took 0.207852 seconds strcmp with non-matching strings took 0.215276 seconds === with matching strings took 0.067122 seconds === with non-matching strings took 0.057305 seconds === is the clear winner. Function call...
0 2025 posted 17 years ago by mthorn
Since PHP is typeless odd things can happen when a variable is not the type you expected. PHP treats 0, null, '0', false, and '' as false. Sometimes you really want to know if the value is false. The solution is simple, use the triple equal (===) ope...
0 794 posted 17 years ago by mthorn
Often PHP can't interpret POST data because it is not form-encoded. This is typical when the post data is XML from API's like Flash's XmlSocket. You can use the following methods to read the POST data directly.
1 1285 posted 17 years ago by mthorn
Will create a thumnail no taller or wider than the supplied size. Also contains some tips for reading and writing images using GD.
22 7477 posted 17 years ago by mthorn
« Prev 1 Next »