Results 1 to 7 of 7

Thread: How To : Improve Your PHP Programming

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Posts
    5

    Default

    ill try that

  2. #2
    Join Date
    Sep 2008
    Posts
    4

    Default thx

    thanks guy , i will try that

  3. #3
    Join Date
    Sep 2008
    Posts
    6

    Default nice tips...

    These are good tips to improve php coding... Having a good coding convention will help especially in debugging..

  4. #4
    Join Date
    Feb 2009
    Posts
    5

    Default

    thanks a lot

  5. #5
    Join Date
    Feb 2009
    Posts
    7

    Default

    Ild just like to point out something on the echo and print argument. You say "The echo command is much faster than the print command". I'ld like to point out why.

    Print has a return value, echo does not.


    Consider:

    PHP Code:
     <?php 

    if (print('foo')) { print('foo printed'); } // Will be true 

    if (echo('foo')) { echo('foo printed'); } // Will be false 

    ?>
    Evidently print will always return logical true (1), unless there is a serious error with PHP and the string does not print. Obviously PHP uses C prototypes but I will convert them into PHP so we can see what is going on.

    PHP Code:
     <?php 

    function print($stringToPrint) { 
      
    system.out($stringToPrint); 
      return 
    1


    function echo (
    $stringToPrint) { 
      
    system.out($stringToPrint); 


    ?>
    Hope that helps clear that up.

    ________________
    credit counseling cheapest loans

  6. #6
    Join Date
    Mar 2009
    Posts
    6

    Default ...

    wow thanks so much, this helped me a lotttt, liek i was so clueless before and now i know a lot mroe, thanks again, (:

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •