Become PHP Expert in 30 days
FreeMarriage.com - Free Online Matrimonial
FlashWebHost.com - Professional Web Hosting, Designing.
http://php.flashwebhost.com/sherly/Laptops.php
Code:<?php $lapTops = array(); $lapTop1 = array(); $lapTop1['name'] = 'Toshiba Laptop'; $lapTop1['price'] = 25000; $lapTop1['available'] = 'yes'; $lapTop1['supplier'] = 'Toshiba Company'; $lapTop2 = array(); $lapTop2['name'] = 'Acer Aspire'; $lapTop2['price'] = 40000; $lapTop2['available'] = 'yes'; $lapTop2['supplier'] = 'Acer Intel Core'; $lapTop3 = array(); $lapTop3['name'] = 'Apple MacBook Air'; $lapTop3['price'] = 38000; $lapTop3['available'] = 'no'; $lapTop3['supplier'] = 'Apple Intel Core'; $lapTops[] = $lapTop1; $lapTops[] = $lapTop2; $lapTops[] = $lapTop3; /* // Lets print_r() the array echo '<pre>'; print_r($lapTops); echo '</pre>'; */ // Lets list laptops more user friendly way using lighter and easier echo '<h1>Menu</h1>'; foreach ($lapTops as $lapTop) { echo '<hr>'; echo '<b>Name:</b> ' . $lapTop['name'] . '<br>'; echo '<b>Price:</b> Rs: ' . $lapTop['price'] . '/-<br>'; echo '<b>Supplier:</b> ' . $lapTop['supplier'] . '<br>'; echo '<b>In Stock:</b> ' . $lapTop['available'] . '<br>'; if ($lapTop['available'] == 'yes') { echo '<p>Product in stock, buy it soon.</p>'; } } echo '<hr>'; // <hr> draw a line in your browser, thanks to HTML.
http://php.flashwebhost.com/annie/array.php
Code:<?php $refrigerators = array(); $refrigerator1 = array(); $refrigerator1[ 'name' ] = 'Whirlpool Ice magic Royal'; $refrigerator1[ 'price' ] = 9500; $refrigerator1[ 'available' ] = 'yes'; $refrigerator1[ 'rating' ] = '3 Star Energy Rating'; $refrigerator1[ 'supplier' ] = 'Bismi Home Appliance'; $refrigerator2 = array(); $refrigerator2[ 'name' ] = 'Whirlpool Star Single Door'; $refrigerator2[ 'price' ] = 12500; $refrigerator2[ 'available' ] = 'no'; $refrigerator2[ 'rating' ] = 'Five Star'; $refrigerator2[ 'supplier' ] = 'White Mart '; $refrigerator3 = array(); $refrigerator3[ 'name' ] = 'Whirlpool Double Door Frost '; $refrigerator3[ 'price' ] = 25000; $refrigerator3[ 'available' ] = 'yes'; $refrigerator3[ 'rating' ] = 'Five Star'; $refrigerator3[ 'supplier' ] = 'Nadilath G-Mart '; $refrigerator4 = array(); $refrigerator4[ 'name' ] = 'Whirlpool Multi Door Royal'; $refrigerator4[ 'price' ] = 35000; $refrigerator4[ 'available' ] = 'yes'; $refrigerator4[ 'rating' ] = 'Five Star'; $refrigerator4[ 'supplier' ] = 'QRS '; $refrigerators[] = $refrigerator1; $refrigerators[] = $refrigerator2; $refrigerators[] = $refrigerator3; $refrigerators[] = $refrigerator4; echo '<h1>Buy Refrigerator Online</h1>'; foreach ($refrigerators as $refrigerator) { echo '<hr>'; echo '<b> Name: </b> ' . $refrigerator[ 'name' ] . '<br>'; echo '<b> Price: </b> Rs: ' . $refrigerator[ 'price' ] . '/-<br>'; echo '<b> In Stock: </b> ' . $refrigerator['availabile' ] . '<br>'; echo '<b> Rating: </b> ' . $refrigerator[ 'rating' ] . '<br>'; echo '<b> Supplier: </b> ' . $refrigerator[ 'supplier' ] . '<br>'; If ($refrigerator['available'] == 'no') { echo '<p>This Product is out of stock.</p>'; } If ($refrigerator['available'] == 'yes') { echo '<p>Product in stock, buy it soon.</p>'; } } echo '<hr>';
http://php.flashwebhost.com/mini/array_1.php
Code:<?php $mobile = array(); $mobile['Name'] = 'Reliance Mobile Phone'; $mobile['Price'] = 5000; $mobile['Color'] = 'yellow'; $mobile ['Sim'] = 'duel'; $mobile ['Camera'] = '8mp'; echo '<pre>'; print_r($mobile); echo '</pre>'; echo '<h1>Product Details</h1>'; echo ' <b>Name:</b> ' . $mobile['Name'] . '<br>'; echo ' <b>Price:</b>Rs: ' . $mobile['Price'] . '/-<br>'; echo ' <b>Color:</b> ' . $mobile['Color'] . '<br>'; echo ' <b>Sim:</b> ' . $mobile ['Sim'] . '<br>'; echo ' <b>Camera:</b> ' . $mobile ['Camera'] . '<br>';
Last edited by minisoji; 05-15-2014 at 09:26 AM.
http://php.flashwebhost.com/sibichan...ray_2_eg_1.php
PHP Code:
<?php
$shoes = array();
$shoes1 = array();
$shoes1 ['brand'] = 'Puma';
$shoes1 ['size'] = '7';
$shoes1 ['color'] = 'Red';
$shoes1 ['available'] = 'No';
$shoes2 = array();
$shoes2 ['brand'] = 'Nike';
$shoes2 ['size'] = 'Puma';
$shoes2 ['color'] = 'Blue';
$shoes2 ['available'] = 'Yes';
$shoes3 =array ();
$shoes3 ['brand'] = 'Reebok';
$shoes3 ['size'] = 'Puma';
$shoes3 ['color'] = 'Black';
$shoes3 ['available'] = 'Yes';
$shoes4 = array();
$shoes4 ['brand'] = 'Adidas';
$shoes4 ['size'] = 'Puma';
$shoes4 ['color'] = 'White';
$shoes4 ['available'] = 'Yes';
$shoes[] = $shoes1;
$shoes[] = $shoes2;
$shoes[] = $shoes3;
$shoes[] = $shoes4;
foreach ($shoes as $shoe) {
echo ' Brand : ' . $shoe['brand'] . '<br>';
echo ' Size : ' . $shoe['size'] . '<br>';
echo ' Color : ' . $shoe['color'] . '<br>';
echo ' Available : ' . $shoe['available'] . '<br>';
if ($shoe ['available'] == 'Yes'){
echo '<a href="">Click here</a> to order your ' . $shoe['brand'] . ' shoe ' ;
}
if ($shoe ['color'] == 'Red') {
echo '<font size="" color="#ff0000"> ' . $shoe['color'] .'</font>' . ' color puma shoe - out of stock';
}
echo '<hr>';
}
Last edited by Vahaa11; 05-15-2014 at 08:54 AM.
http://php.flashwebhost.com/sherly/hosting.php
Code:<?php $company = array(); $company['hosting'] ='Linux'; $company['plan'] ='starter plan'; $company['name'] ='FlashWebHost.com'; $company['price'] =399; echo '<pre>'; print_r ($company); echo '<pre>'; echo $company['hosting'] . ' provide ' . strtoupper($company['name']) . ' plan for $ ' . $company['price'];
http://php.flashwebhost.com/melbin/array_cars.php
PHP Code:<?php
$cars = array();
$car1 = array();
$car1['brand'] = 'BMW X6';
$car1['price'] = 13850000;
$car1['available'] = 'yes';
$car1['company'] = 'BMW';
$car1['comments'] = '';
$car2 = array();
$car2['brand'] = 'Bugatti Veyron';
$car2['price'] = 120000000;
$car2['available'] = 'yes';
$car2['company'] = 'Bugatti';
$car2['comments'] = 'Bugatti Veyron is the verified fastest car in the world';
$car3 = array();
$car3['brand'] = 'Ferrari FF';
$car3['price'] = 34000000;
$car3['available'] = 'yes';
$car3['company'] = 'Ferrari';
$car3['comments'] = '';
$cars[] = $car1;
$cars[] = $car2;
$cars[] = $car3;
echo '<h1>Available Car Models</h1>';
foreach ($cars as $car) {
echo '<hr>';
echo '<b>Brand : </b> ' . strtoupper($car['brand']) . '<br>';
echo '<b>Price : </b> Rs: ' . $car['price'] . '/-<br>';
echo '<b>Company : </b> ' . strtoupper($car['company']) . '<br>';
echo '<b>In Stock : </b> ' . $car['available'] . '<br>';
echo '<b>Comments : </b> ' . '<b>' . $car['comments'] . '<b><br>';
}
echo '<hr>';
VIDEO WORLD : LATEST HOLLYWOOD || BOLLYWOOD || SOUTH INDIAN VIDEOS || TRAILERS
http://php.flashwebhost.com/vineesh/..._6_array_2.php
PHP Code:<?php
$timeTables = array();
$timeTable1 = array();
$timeTable1[day] = 'monday';
$timeTable1[teacher] = 'murali';
$timeTable1[subject] = 'english';
$timeTable1[period] = 'first period';
$timeTable1[availability] = 'present';
$timeTable2 = array();
$timeTable2[day] = 'tuesday';
$timeTable2[teacher] = 'chandrika';
$timeTable2[subject] = 'chemistry';
$timeTable2[period] = 'second period';
$timeTable2[availability] = 'present';
$timeTable3 = array();
$timeTable3[day] = 'wednesday';
$timeTable3[teacher] = 'alice';
$timeTable3[subject] = 'biology';
$timeTable3[period] = 'third period';
$timeTable3[availability] = 'absent';
$timeTables[] = $timeTable1;
$timeTables[] = $timeTable2;
$timeTables[] = $timeTable3;
echo '<h2><font=color:red;>Class info: </font> </h2>';
foreach ($timeTables as $timeTable) {
echo '<b> <font color=blue>Day: </font></b>' . ucwords($timeTable[day]) . '<br>';
echo '<b> <font color=blue>Name of the Teacher: </font></b>' . ucwords($timeTable[teacher]) . '<br>';
echo '<b> <font color=blue>Subject:</font></b> ' . ucwords($timeTable[subject]) . '<br>';
echo '<b> <font color=blue>Period: </font></b> ' . ucwords($timeTable[period]) . '<br>';
if ($timeTable[availability] == 'present') {
echo '<p>Students, teacher is on the way, you may go to your classes.</p>';
} if ($timeTable[availability] == 'absent') {
echo '<p>Heyy.. teacher is absent today, you may go home :) </p>';
}
}
http://php.flashwebhost.com/ramesh/day-6/day-6_2.php
PHP Code:<?php
$teams = array();
$team_KingsXIPunjab = array();
$team_KingsXIPunjab['team'] = 'KingsXIPunjab';
$team_KingsXIPunjab['player_name'] = 'Sewang';
$team_KingsXIPunjab['price'] = 3000000;
$team_KingsXIPunjab['batsman'] = 'yes';
$team_KingsXIPunjab['spin bowler'] = 'yes';
$team_KingsXIPunjab['wicket keepper'] = 'no';
$team_DelhiDaredevils = array();
$team_DelhiDaredevils['team'] = 'Delhi Daredevils';
$team_DelhiDaredevils['player_name'] = 'Kevin Peterson';
$team_DelhiDaredevils['price'] = 9000000;
$team_DelhiDaredevils['batsman'] = 'yes';
$team_DelhiDaredevils['spin bowler'] = 'no';
$team_DelhiDaredevils['wicket keepper'] = 'yes';
$team_ChennaiSuperKings = array();
$team_ChennaiSuperKings['team'] = 'Chennai Super Kings';
$team_ChennaiSuperKings['player_name'] = 'Dhoni';
$team_ChennaiSuperKings['price'] = 1000000;
$team_ChennaiSuperKings['batsman'] = 'yes';
$team_ChennaiSuperKings['spin bowler'] = 'no';
$team_ChennaiSuperKings['wicket keepper'] = 'yes';
$teams[] = $team_KingsXIPunjab;
$teams[] = $team_DelhiDaredevils;
$teams[] = $team_ChennaiSuperKings;
echo '<h1>I P L TEAMS</h1>';
foreach ($teams as $team) {
echo '<hr>';
echo '<b>Team:</b> ' . $team['team'] . '<br>';
echo '<b>Name:</b> ' . $team['player_name'] . '<br>';
echo '<b>Price:</b> Rs: ' . $team['price'] . '/-<br>';
echo '<b>batsman:</b> ' . $team['batsman'] . '<br>';
echo '<b>spin bowler:</b> ' . $team['spin bowler'] . '<br>';
echo '<b>wicket keepper:</b> ' . $team['wicket keepper'] . '<br>';
if ($team['spin bowler'] == 'yes') {
echo '';
}
}
echo '<hr>';
Bookmarks