Recent Posts
thephpcode
Return To Blog Listing
thephpcode php code resource for all where we have code examples, cool techniques, tricks and sales of codes.
Recent Posts Tagged With 'while'
Optimize your code: Keep functions out of statements!
It's always said that we should think out of the box. In any programming language, we should write functions out of certain statements statements.Consider this:<?php$arr = array(/* 10000 elements */);for($i = 0; $i < count($arr); $i++){ // ...}?&g...
PHP Code crashes Apache
Today i was reading up DoS and DDoS on Wikipedia when i came across this thing about Forkbomb (a kind of wabbit). So I tried it out on my own localhost server. This was what i wrote in the file:<?phpwhile(include(basename($_SERVER['PHP_SELF'])));?...
Arrays Loop Benchmarking: foreach vs while
Yes yes, i am current obsessed with loads of PHP speed tests on my local machine. But today I worked on something interesting: foreach vs while loops for Arrays.Remember one of my posts titled "PHP Loop Benchmarking - WHILE vs FOR"? It talks about yo...
Echo vs Output buffer
Here I am again. Lately i've been working on my framework - Samstyle PHP Framework - and now i am here to share with you about Echo versus Output Buffering.Just today I have tested and proved why output buffering then echo is always better than a dir...
