• AddThis Social Bookmark Button

    Add to Technorati Favorites

  • Archives

  • Archive for November, 2007

    Numeric array’s in php

    Friday, November 30th, 2007

    Sometimes you need to create many similar variables. So you need arrays

    There are three different kind of arrays:

    • Numeric array
    • Associative array
    • Multidimensional array

    In this post we will only discuss Numeric array:

    Syntax:

    $yourname = array(“Kushagra”,”Sanjay”,”Salman”);

    or

    $yourname[0] = “Kushagra”;

    $yourname[1] = “Sanjay”;

    $yourname[2] = “Salman”;

    Example 1

    <?php

    $yourname[0] = “Kushagra”;

    $yourname[1] = “Sanjay”;

    $yourname[2] = “Salman”;

    echo $yourname[0].” Was first named “.$yourname[1].” And then “.$yourname[2];

    ?>

    Thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace

    For loop in php

    Thursday, November 29th, 2007

    Think of a bucket of water which is heated at 100 degree centigrate in

    Once started getting heated it will store the heat and take more to raise the temp.

    Similarly the loops works

    for example:

    <?php

    $i=0;

    for($l=1;$l<=$i;i++)

    {

    echo “www.easytutorial.com is great”;

    }

    ?>

    Thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace

    Variables in php

    Wednesday, November 28th, 2007

    What does php stands for ??

    PHP = presyntax hyper processor

    so the string presyntax hyper processor is stored in the varible PHP

    In php you can also store big calculations or strings or anything in a variable

    In php variable prefix is $

    so a simple variable program will look like this

    <?php

    $easy = “http://www.easytutorial.info”;
    echo ‘For web designing tutorial go to <a href=”‘.$easy.’”>Easy tutorials’;

    ?>

    Thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace

    A simple java program under blue-j environment

    Thursday, November 15th, 2007

    class calculate

    {

       public void cal(double a,double b)

    {

    double c=0;

    c= a+b;

    System.out.print(“After adding the two number the result was  ” + c);

    }

    }

    This program will accept two numbers and give the result after adding both the numbers :D

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace

    Looping through the headers in javascript

    Saturday, November 10th, 2007

    Well it is a good thing to look at looping examples to learn it thoroughly:

    example looping through the headers

    <html>
    <body>

    <script type=”text/javascript”>
    for (i = 1; i <= 6; i++)
    {
    document.write(“<h” + i + “><center>welcome to the jungle</center>”)
    document.write(“</h” + i + “>”)
    }
    </script>

    </body>
    </html>

    This will loop through the heading tags using the for event

     Thanks

    krates

    Share and Enjoy:
    • Digg
    • del.icio.us
    • Facebook
    • NewsVine
    • Reddit
    • StumbleUpon
    • YahooMyWeb
    • Google Bookmarks
    • Yahoo! Buzz
    • TwitThis
    • Live
    • LinkedIn
    • Pownce
    • MySpace