Array that defines product information and generates the html for the product Is there a more productive way to do this? Is my code up to standards or up to best practices?

   &lt;?php

    /*
      FILE:       index.php
      AUTHOR:     Darcey Mckelvey
      PURPOSE:    View Products
    */

    // Define product information
    $products[0] = array(
      'name' =&gt; 'Sneakers',
      'price' =&gt; 24.99,
      'category' =&gt; 'Shoes',
      'description' =&gt; 'Black sneakers. Good for walking or athletic activity'
    );

    $products[1] = array(
      'name' =&gt; 'Armani Red Silk Shirt',
      'price' =&gt; 379.99,
      'category' =&gt; 'Shirts',
      'description' =&gt; 'Fancy Italian red silk shirt. Very spiffy, sure to attract the ladies'
    );

    echo "&lt;h2 style='text-align:center;'&gt;Welcome to DropShop!&lt;/h2&gt;
          &lt;h3&gt;Our Products&lt;/h3&gt;";


    // Loop to display all products
    foreach($products as $product) {
      echo "&lt;p&gt;&lt;span style='font-weight:bold;'&gt;" . $product['name'] . "&lt;/span&gt;&lt;br /&gt;" .
      "Price: $" . $product['price'] . "&lt;br /&gt;" .
      "Category: " . $product['category'] . "&lt;br /&gt;" .
      $product['description'] . "&lt;/p&gt;";
    }

    ?&gt;
Well, if this is the real code and not a sample (like, data you're getting in $products is not fetched from the database), then there isn't much use of hard-coding a PHP array just to immediately use it to display HTML paragraphs - why not just write everything as HTML?

Other than that, you're implicitly creating an array (there's no $products = array() first). It's not an error, but it can be a little confusing. My immediate reaction was "where is $product coming from?". Also, you don't need to declare each element separately, you can do everything "at once" like this:

$products = array(
  array(
    'name' =&gt; 'Sneakers',
    'price' =&gt; 24.99,
    'category' =&gt; 'Shoes',
    'description' =&gt; 'Black sneakers. Good for walking or athletic activity'
  ),
  array(
    'name' =&gt; 'Armani Red Silk Shirt',
    'price' =&gt; 379.99,
    'category' =&gt; 'Shirts',
    'description' =&gt; 'Fancy Italian red silk shirt. Very spiffy, sure to attract the ladies'
  )
);


Also, mixing PHP and HTML in single file isn't good practice, except when you're just echo-ing data in a "view". Other than that, logic should be separated.