Rakibul_Ahasan

Php(Index and Associative Array)

Jan 28th, 2021
969
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2. <html lang="en">
  3.   <head>
  4.     <!-- Required meta tags -->
  5.     <meta charset="utf-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1">
  7.  
  8.     <!-- Bootstrap CSS -->
  9.     <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
  10.  
  11.     <title>Hello, world!</title>
  12.   </head>
  13.   <body>
  14.  
  15.     <?php
  16.  
  17.        $mobile = [
  18.            'image' => 'Image/mobile.jpg',
  19.            'Name' => 'Oppo A5',
  20.            'Price' => '20000 tk',
  21.            'Colors' => array('Blue','Black','Read','gray')
  22.        ];
  23.     ?>
  24.  
  25.      <div class="container card bg-primary text-white">
  26.        <div class="row  mx-auto">
  27.           <div class="col-md-6">
  28.             <div class="media">
  29.               <img style="float: left;" src=" <?php echo $mobile['image'] ?> " weight='300' height='300'>
  30.               <div style="float: left;" class="media-body">
  31.                 <h3>Name: <?php echo $mobile['Name'] ?> </h3>
  32.                 <h3>Price: <?php echo $mobile['Price'] ?> </h3>
  33.                 <h3>Color: </h3>
  34.                  <ul class="list">
  35.                     <li> <?php echo $mobile['Colors'][0]; ?> </li>
  36.                     <li> <?php echo $mobile['Colors'][1]; ?> </li>
  37.                     <li> <?php echo $mobile['Colors'][2]; ?> </li>
  38.                     <li> <?php echo $mobile['Colors'][3]; ?> </li>
  39.                  </ul>
  40.               </div>
  41.             </div>
  42.           </div>
  43.        </div>
  44.      </div>
  45.  
  46.      <!-- <div class="card bg-info">
  47.        <h3>Name: <?php //echo $mobile['Name'] ?> </h3>
  48.        <h3>Price: <?php //echo $mobile['Price'] ?> </h3>
  49.        <h3>Color: </h3>
  50.          <ul class="list">
  51.             <li> <?php //echo $mobile['Colors'][0]; ?> </li>
  52.             <li> <?php //echo $mobile['Colors'][1]; ?> </li>
  53.             <li> <?php //echo $mobile['Colors'][2]; ?> </li>
  54.             <li> <?php //echo $mobile['Colors'][3]; ?> </li>
  55.          </ul>
  56.      </div> -->
  57.    
  58.     <!-- Option 1: Bootstrap Bundle with Popper -->
  59.     <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
  60.   </body>
  61. </html>
RAW Paste Data