• function return value

      0 comments

    What will be the out put of the following code snippet?
    if(!r())
    echo ‘aaa’;
    else
    echo ‘err’;

    function r(){
    //return 1;
    }

    Here you will not get a chance to execute and see what is the out put.  So you have to know exactly what will happen here. Probably even if you are a php pro, sometimes you might get confused here.
    It will print “aaa”, even though the function do not return anything.

  • POST and GET Methods

      0 comments

    Which will execute faster POST or GET?

    GET transfer data to the server using URL whereas POST transfer data using form collection which is added to the request by the browser. We can send at most 1024 bytes using URL hence there is upper limit for GET method POST method can transfer large amount of data where upper limit is imposed by web server which is about 2MB data is shown to the user in GET method.

    Get is faster but not safe.
    http://www.tutorialspoint.com/php/php_get_post.htm