• why cakephp? interview question

      0 comments

    In an interview the interviewer asked,

    Why we use cakephp? We can just have our own structure and keep developing projects without making things more complicated. Why cake?

    The best answer for this question from the cakephp Cookbook is,

    We don’t have to re-invent the wheel. Every time we sit for a new project, we have a more structural way of developing the project with an already installed development environment and we just have to start our rapid application straight a way with the business logic.

    Some of the key features the framework provides are,
    - MVC structure
    - Code generation
    - CRUD for database interaction
    - Application scaffolding
    - Code generation
    - Built-in validation
    - Data sanitation
    - Flexible casching
    - Localization

    and lot more………

    Our primary goal is to enable you to work in a structured and rapid manner–without loss of flexibility – by cakephp org.

  • Strings and regular expressions

      0 comments

    What will be the answer of the following code snippet?

    echo 'Testing ' . 1 + 2 . '45';
    

    Simply you will give the answer as : Testing 345

    But the answer is : 245

    That is because you can not sum a number with a string. The first part, before the plus mark is a string though there is 1 there.
    So engine will simply get it as 0 and the latter part as 245. so answer will be 245.