[ create a new paste ] login | about

Link: http://codepad.org/Qi9RZs2Y    [ raw code | output | fork ]

PHP, pasted on Apr 28:
<?php
$array = array( array( Title => "rose", 
                  Price => 1.25,
                  Number => 15 
                ),
           array( Title => "daisy", 
                  Price => 0.75,
                  Number => 25,
                ),
           array( Title => "orchid", 
                  Price => 1.15,
                  Number => 7 
                )
         );
    $closing = "Thank you.";
    $details = '';
    foreach($array as $row){
        $title = $row['Title'];
        $price = $row['Price'];
        $number = $row['Number'];


        $details .= "
    Title: $title
    Price: $price 
    Number: $number
    ";
    }
    $message ="
    $headers

    $details

    $closing
    ";
echo $message;


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

    

    
    Title: rose
    Price: 1.25 
    Number: 15
    
    Title: daisy
    Price: 0.75 
    Number: 25
    
    Title: orchid
    Price: 1.15 
    Number: 7
    

    Thank you.
    


Create a new paste based on this one


Comments: