Recent Posts

thephpcode

thephpcode

Return To Blog Listing

thephpcode php code resource for all where we have code examples, cool techniques, tricks and sales of codes.

Search This Blog's Tags For:

Recent Posts Tagged With 'while'

  • Optimize your code: Keep functions out of statements!

    Posted on Sunday August 23rd, 2009 at 19:22 in speed, functions, statement, optimize, while, loop

    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

    Posted on Sunday July 19th, 2009 at 08:43 in test, crash, load, while, loop, xampp, apache friends

    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

    Posted on Saturday July 4th, 2009 at 23:48 in tips, speed, test, while, benchmark, loop, foreach

    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

    Posted on Monday June 29th, 2009 at 05:16 in speed, test, output, while, echo, benchmark, 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...