Loading Arrays from Files (use for loop)

$number_of_orders = count($orders);
if ($number_of_orders == 0){
echo ”

No orders pending.Please try again later.



for ($i=0;$i<$number_of_orders;$i++){

echo $orders[$i].”


3 dimensional arrays with for loop

    $categories = array(array( array( ‘CAR_TIR’, ‘Tires’, 100 ),
                        array( ‘CAR_OIL’, ‘Oil’, 10 ),
                        array( ‘CAR_SPK’, ‘Spark Plugs’, 4 ) ),
                 array( array( ‘VAN_TIR’, ‘Tires’, 120 ),
                        array( ‘VAN_OIL’, ‘Oil’, 12 ),
                        array( ‘VAN_SPK’, ‘Spark Plugs’, 5 ) ),
                array( array( ‘TRK_TIR’, ‘Tires’, 150 ),
                        array( ‘TRK_OIL’, ‘Oil’, 15 ),
                        array( ‘TRK_SPK’, ‘Spark Plugs’, 6 ) )
    for ($layer =0;$layer <3; $layer++){
        echo “layer $layer<br/>”;
        for ($row =0; $row<3; $row++){
            for ($column =0; $column<3; $column++){
            echo ‘|’.$categories[$layer][$row][$column];
            echo ‘|<br/>’;

a simple sample for loop and while loop in php

$prices = array(‘Tires’=>100, ‘Oil’=>10, ‘Spark Plugs’=>4);

The foreach loop has a slightly different structure when using associative arrays.You
can use it exactly as you did in the previous example, or you can incorporate the keys as
foreach ($prices as $key => $value) {
echo $key.” – “.$value.”<br />”;

The following code lists the contents of the $prices array using the each() construct:
while ($element = each($prices)) {
echo $element[‘key’];
echo ” – “;
echo $element[‘value’];
echo “<br />”;

There is a more elegant and more common way of doing the same thing.The construct
list() can be used to split an array into a number of values.You can separate two
of the values that the each() function gives you like this:
while (list($product, $price) = each($prices)) {
echo “$product – $price<br />”;

The output of this script fragment is shown in Figure 3.2.

Tires – 100
Oil – 10
Spark Plugs – 4

Visual Studio 2010 freedown + Crack

first:Microsoft Visual Studio 2010 down(come from www.microsoftstore.com

      (Premium) 【link】



then,Help->Register Product->:YCFHQ-9DWCY-DKV88-T2TMH-G7BHP then enter



or you can

       use thisProduct Key:YCFHQ9DWCYDKV88T2TMHG7BHP,to cover setup.sdb [Product Key]

if you already install fee trial, just change Product Key:YCFHQ9DWCYDKV88T2TMHG7BHP,then fine.

xml and xsl and css connected example

first, you need have a wine.xml,this is for store your wines database: see below:

<?xml version=”1.0″ encoding=”UTF-8″?>
<?xml-stylesheet type=”text/css” href=”wine.css”?>
<!DOCTYPE wines [
<!ELEMENT wines (wine+)>
<!ELEMENT wine (name,country,location,history,color,year,served)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT location (#PCDATA)>
<!ELEMENT history (#PCDATA)>
<!ELEMENT color (#PCDATA|span)*>
<!ELEMENT served (#PCDATA)>
<?xml-stylesheet type=”text/xsl” href=”wine.xsl”?>
<name>Rough Red</name>
<history>Some oenologists believe that Rough Red goes back to Roman times.</history>
<color>dark ruby-red wine – traditionally, it is called,<span>”black as rabbit’s blood”</span></color>
<served>Rough Red should be served at 15 – 16 _C(59 – 60.8_F)

<name>Cabernet Merlot</name>
<country>South Australia</country>
<history>A soft, round and gloriously fleshy palate delivers flavours of ripe plum, red berries along with subtle liquorice and chocolate, finishing in a smooth and elegant fashion.
This is such an easy-drinking, soft and approachable wine. There is wonderful flavour and richness but it’s not at all confronting…a bit like a red wine with training wheels…and a true little treasure!</history>
<color>dark ruby-red wine – traditionally, it is called,<span>”black as rabbit’s blood”</span></color>
<served>Rough Red should be served at 15 – 16 _C(59 – 60.8_F)


Then,save as win.xml you use xsl to style your wines’ data, see below(xml can let your xml data display in html ) Continue reading xml and xsl and css connected example

What is XML? What is XSL? What is the relationship between XML AND XSL?

What is XML?

  • XML stands for EXtensible Markup Language
  • XML is a markup language much like HTML
  • XML was designed to carry data, not to display data
  • XML tags are not predefined. You must define your own tags
  • XML is designed to be self-descriptive
  • XML is a W3C Recommendation

What is XSL?

XSLT is the recommended style sheet language of XML.

XSLT (eXtensible Stylesheet Language Transformations) is far more sophisticated than CSS.

XSLT can be used to transform XML into HTML, before it is displayed by a browser.

What is the relationship between XML AND XSL?

XSL gives your XML some style

banner slide show

<!doctype html>

        <style type="text/css" media="screen">
            .slides_container {
            .slides_container div {

        <script src="http://code.jquery.com/jquery-latest.min.js"></script>
        <script src="slides.js"></script>

        <div id="slides">
            <div class="slides_container">
                    <img src="http://placehold.it/570x270">
                    <img src="http://placehold.it/570x270">
                    <img src="http://placehold.it/570x270">
                    <img src="http://placehold.it/570x270">

chinese_Zodiac_for_loop in php

$startYear = 1912;
$endYear = 2013;
$numYears = ($startYear – $endYear) + 1;
$animalsUpper = array(“RAT”, “OX”, “TIGER”, “RABBIT”, “DRAGON”, “SNAKE”, “HORSE”, “GOAT”, “MONKEY”, “ROOSTER”, “DOG”, “PIG”);
$animalsLower = array(“rat”, “ox”, “tiger”, “rabbit”, “dragon”, “snake”, “horse”, “goat”, “monkey”, “rooster”, “dog”, “pig”);

echo “<table border=\”1\” align=\”center\”><tr>”;

for ($i = 0; $i < 12; ++$i) {
echo “<th align=\”center\”>” . $animalsUpper[$i] . “</th>”;

echo “</tr><tr>”;

for ($i = 0; $i < 12; ++$i) {
echo “<td align=\”center\”><img src=\”images/” . $animalsLower[$i] . “.jpg\”></td>”;

for ($i = $startYear; $i <= $endYear; ++$i) {
if ((($i – $startYear) % 12) == 0) {
echo “</tr><tr>”;
echo “<td align=\”center\”>” . $i . “</td>”;

echo “</tr></table>”;

Full stack developer