Topic
  • 8 replies
  • Latest Post - ‏2011-10-10T03:42:59Z by zabalex
InformationMedia21
InformationMedia21
2 Posts

Pinned topic Information media 21 asking difference between PHP and Asp.net

‏2010-12-14T11:19:19Z |
Information media 21 Says

I have been worked on different types of web application, but still i m confuse i m working on ASP.net and many people says PHP is better then ASP.net so please suggest me..

Thanks..
Updated on 2011-10-10T03:42:59Z at 2011-10-10T03:42:59Z by zabalex
  • InformationMedia21
    InformationMedia21
    2 Posts

    Re: Information media 21 asking difference between PHP and Asp.net

    ‏2010-12-14T11:20:38Z  
    Information media 21

    Please Answer me as soon as possible....!
  • hendryimedia21
    hendryimedia21
    2 Posts

    Re: Information media 21 asking difference between PHP and Asp.net

    ‏2010-12-14T11:26:31Z  
    Hi ...
    these are few topics ...
    1. Is there any difference between '' and "" in ASP.NET?

    Yes, ' ' is used for characters while " " is for strings.

    Take this for example:
    'a' = a in memory
    "a" = a and \0 in memory

    Something usefull about escaping in ASP.NET is the following:
    @"bla\bla" == "bla\\bla"

    A string with an @ in front of it is seen as a literal, where you don't have to escape special characters.
    2. How would I do something like: print $variable.'string'; in ASP.NET?

    You would use the following: Response.Write(variable + "string");
    But it isn't very recommended to use Response.Write, take a look at all the server controls you have, like a Label for example.
    3. Within an if language construct, what would be the equivalent of "and" and "or?"

    Actually PHP supports the same being used in ASP.NET:

    and --> &&
    or --> ||

    Example:

    if (((number == 5) && (number2 != 8)) || (admin == true)) {

    // do stuff

    }
    Would correspond to:
    if (number = 5 AND number2 NOT equal to 8 ) OR we're an admin., do stuff.
    4. Would someone be able to tell me how I could make an ASP.NET equivalent of this PHP Function:

    function num($number){
    return '#' . str_pad($number, 3, '0', STR_PAD_LEFT);
    }
    You need a function which returns a string, and which formats a string:
    public string num(int number) {

    return String.Format("#{0}", number.ToString("000"));

    }

    5. How do I create a mutidimensional array?

    Try this:

    // 2 dimensional arrays

    int [,] a1;

    a1 = new int3,2;

    int [,] a2 = {{1,2}, {3,4}, {5,6}};

    // jagged arrays

    int][ a3;

    a3 = new int3][;

    a3[0] = new int[5]{1, 2, 3, 4 ,5};

    a3[1] = new int[3];

    a3[2] = new int[4]{21, 22, 23, 24};

    Loop over them to see the elements.

    __________________________________
    Got a question yourself? Ask it, and I'll try to help :)
  • hendryimedia21
    hendryimedia21
    2 Posts

    Re: Information media 21 asking difference between PHP and Asp.net

    ‏2010-12-14T11:27:46Z  
    Information media 21

    Please Answer me as soon as possible....!
    i hope answer satisfy you
    Thanks....
  • DavidSeo
    DavidSeo
    1 Post

    Re: Information media 21 asking difference between PHP and Asp.net

    ‏2011-03-13T11:02:23Z  
    Most of the websites are built around PHP. Therefore, if you are an ASP.net application programmer then you dont have to worry about this fact.

    However, if you are an ASP.net web application developer then you will find more PHP websites as compared to Asp.net websites.

    ASP servers are paid whereas Apache server is free.

    You will have to see it yourself whether you are more comfortable with C# or PHP programming. If you feel more comfortable and have expertise in C# then go for ASP.net.

    On the other hand if you have started web development recently and are not familiar with either asp.net or PHP then start off with PHP. It would be easier and enjoyable experience for you.
  • AnnaHussie
    AnnaHussie
    6 Posts

    Re: Information media 21 asking difference between PHP and Asp.net

    ‏2011-03-31T03:33:07Z  
    PHP is much better than ASP.net because this is widely being used by people and they try to be master in that very easily.It is much easier that ASP.
  • SystemAdmin
    SystemAdmin
    161 Posts

    Re: Information media 21 asking difference between PHP and Asp.net

    ‏2011-04-04T15:16:54Z  
    I would encourage you to pick up PHP simply because it is can run on more platforms that ASP.NET. ASP was designed as a Microsoft protocol, so it works best in Windows environments. While Windows is still widely spread on the desktop, servers tend to be a lot more diverse, typically running Apache [1], which works with PHP. PHP is also moving onto mobile devices in Android and other places [2].

    Taking on PHP would probably be good for you, as one can never have too many skills. However, ASP.NET will still be a valuable skill as long as there are sites which use it. (COBOL programmers are still valued in the institutions that have critical, old COBOL stuff laying around.)

    Cheers!

    Chris Walden
    Open Source managing editor, developerWorks

    ---
    1 - Apache Usage Statistics - Websites using Apache (The IIS numbers are shown as well through a link.)
    2 - PHP for Android project (PFA)
  • SystemAdmin
    SystemAdmin
    161 Posts

    Re: Information media 21 asking difference between PHP and Asp.net

    ‏2011-04-04T15:19:29Z  
    I would encourage you to pick up PHP simply because it is can run on more platforms that ASP.NET. ASP was designed as a Microsoft protocol, so it works best in Windows environments. While Windows is still widely spread on the desktop, servers tend to be a lot more diverse, typically running Apache [1], which works with PHP. PHP is also moving onto mobile devices in Android and other places [2].

    Taking on PHP would probably be good for you, as one can never have too many skills. However, ASP.NET will still be a valuable skill as long as there are sites which use it. (COBOL programmers are still valued in the institutions that have critical, old COBOL stuff laying around.)

    Cheers!

    Chris Walden
    Open Source managing editor, developerWorks

    ---
    1 - Apache Usage Statistics - Websites using Apache (The IIS numbers are shown as well through a link.)
    2 - PHP for Android project (PFA)
    By "it is can run" I meant to say that "it runs." sigh Editing is a wonderful thing.

    Chris
  • zabalex
    zabalex
    9 Posts

    Re: Information media 21 asking difference between PHP and Asp.net

    ‏2011-10-10T03:42:59Z  
    Below are only some of the comparisons while there are many. You have to decide which one to choose for development.

    1: You need to pay for OS (windows OS required to run .net framework and to install IIS Server) while Linux and Apache is free.
    2: It is easy to install Apache Server than IIS
    3: You need to create webcontrols by coding in PHP while you just drag and drop webcontrols on your web forms.
    4: PHP is a compiled code while .Net compiles a code such as VB, C# etc.
    5: In .Net there are inbuilt class libraries while in PHP you have to self create your Class files.
    6: Database (MySQL) is free while MSSQL is not
    7: PHP codes are not as easy as .net codes to debug.

    SEO San Francisco