Results 1 to 4 of 4

Thread: Share PHP tricks :

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    1

    Post Share PHP tricks :

    PHP needs no introduction. In the recent past, no other language has gained as much popularity as PHP has in the field of website development. It is simple and so diverse that you can make just about any kind of a website with this. There are lots of tips and tricks hidden away in PHP.

    Share some of the best PHP tricks....

  2. #2
    Junior Member
    Join Date
    Jan 2013
    Posts
    9

    Re: Share PHP tricks :

    Oh, I have no idea what do you mean with "Tricks" ... so, I am really curious, but I doubt it...

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    6

    Re: Share PHP tricks :

    What do you mean with tricks?

  4. #4
    Junior Member
    Join Date
    Jun 2011
    Posts
    21

    Re: Share PHP tricks :

    Shorthand ternary operator:

    Code:
    $x = $x ?: 'default';
    If $x evaluates as truthy, $x will have its own value, otherwise $x has a 'default' value. Useful for null checking.

Posting Permissions

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