• Home
  • Programming Tutorials
    • PHP Tutorials
  • Code Snippets
    • PHP Code Snippets
    • Java Code Snippets
  • Contact Us
  • TIP: When div tag background stops ea...

    When you notice that a div tags background color and other cosmetic features end prior to the text contained in the div tag it makes the page look bad. A tip to fix this prob [...]

    Read more
  • Java: Print Numbers 1 to n
    crystal_java

    /** Displays the numbers 1 to n @param n The last number to display */ public static void numbers1ToN(int n) { // Loop and display the numbers 1 to n for(int i = [...]

    Read more
  • PHP: Function To Display Numbers 1 to...
    page_php

    <?php // function to display the numbers 1 to x function display_numbers($x) { // runs through a loop to display the numbers for($n = 1; $n <= $x; $n++) [...]

    Read more
  • PHP: Simple MD5 Hash Function
    page_php

    <?php function protect_string($string) { // Creates an md5 hash of the variable string and stores the // hash in the variable protected_string. $protected_string [...]

    Read more
  • PHP: Basic Syntax – Tutorial 1
    page_php

    The syntax of a programming language is the way the code is written. PHP syntax is similar to Java, C and other programming languages. Continue reading “PHP: Basic Synt [...]

    Read more
  • PHP: Bubble Sort
    page_php

    function bubbleSort($array) { for ($maxElement = sizeof($array) - 1; $maxElement >= 0; $maxElement--) { for ($index [...]

    Read more

TIP: When div tag background stops early

Jul26th
2012
Leave a Comment Written by Byte Tutorials

When you notice that a div tags background color and other cosmetic features end prior to the text contained in the div tag it makes the page look bad.

A tip to fix this problem is before your ending div tag add in the following code:

<div style="clear: both;"></div>

I hope this tip helps everyone!

Link to this post!
HTML Tutorials, Programming Tutorials    clear, div, float, html, tip
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

Java: Print Numbers 1 to n

Jun18th
2012
Leave a Comment Written by Byte Tutorials
/**
	Displays the numbers 1 to n
	@param n The last number to display
*/

public static void numbers1ToN(int n) {
	// Loop and display the numbers 1 to n
	for(int i = 1; i <= n; n++) {
		// Display the number i
		System.out.println(i);
	}
}
Link to this post!
Code Snippets, Java Code Snippets    for loop, Java, Numbers
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

PHP: Function To Display Numbers 1 to x

Jun10th
2012
Leave a Comment Written by Byte Tutorials
<?php

 // function to display the numbers 1 to x
 function display_numbers($x) {
    // runs through a loop to display the numbers
    for($n = 1; $n <= $x; $n++) {
       // display the number
       echo $n;
    }
 }

?>
Link to this post!
Code Snippets, PHP Code Snippets    echo, for loop, function, Numbers, PHP
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

PHP: Simple MD5 Hash Function

Jun8th
2012
Leave a Comment Written by Byte Tutorials
<?php

function protect_string($string) {
	// Creates an md5 hash of the variable string and stores the
	// hash in the variable protected_string.
	$protected_string = md5($string);

	// returns the value of protected_string to the calling function.
	return $protected_string;
}

?>
Link to this post!
Code Snippets, PHP Code Snippets    function, hash, md5, PHP, protect string
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

PHP: Basic Syntax – Tutorial 1

May29th
2012
Leave a Comment Written by Byte Tutorials

The syntax of a programming language is the way the code is written. PHP syntax is similar to Java, C and other programming languages. Continue reading “PHP: Basic Syntax – Tutorial 1” »

PHP Tutorials, Programming Tutorials    echo, PHP, PHP Tags, Syntax
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail

PHP: Bubble Sort

May25th
2012
Leave a Comment Written by Byte Tutorials
    function bubbleSort($array)
    {
            for ($maxElement = sizeof($array) - 1; $maxElement >= 0; $maxElement--)
            {
                    for ($index = 0; $index <= $maxElement - 1; $index++)
                    {
                            if ($array[$index] > $array[$index + 1])
                            {
                                    $temp = $array[$index];
                                    $array[$index] = $array[$index + 1];
                                    $array[$index + 1] = $temp;
                            }
                    }
            }
            return $array;
    }
Link to this post!
Code Snippets, PHP Code Snippets    array, Bubble Sort, function, PHP, sort
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
<a href="//affiliates.mozilla.org/link/banner/18994"><img src="//affiliates.mozilla.org/media/uploads/banners/f5eeeddc214ed8ef15e48bc80e1f53b0da4f0574.png" alt="Download: Fast, Fun, Awesome" /></a>

Recent Posts

  • TIP: When div tag background stops early
  • Java: Print Numbers 1 to n
  • PHP: Function To Display Numbers 1 to x
  • PHP: Simple MD5 Hash Function
  • PHP: Basic Syntax – Tutorial 1

Tweets

Latest on twitter from bytetutorials 
  • loading...
Follow @bytetutorials

Tags

array Bubble Sort clear div echo float for loop function hash html Java md5 Numbers PHP PHP Tags protect string sort Syntax tip

EvoLve theme by Theme4Press  •  Powered by WordPress Byte Tutorials