Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7167709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:37:55+00:00 2026-05-28T14:37:55+00:00

I find myself frequently repeating HTML code to format items such as lists, tables,

  • 0

I find myself frequently repeating HTML code to format items such as lists, tables, and other areas that have the save format repeated (ie: staff photos). I know there has to be some way to simplify HTML output for sections that use repeated formatting, but I’m not sure if an Array is applicable or if there’s a better way that I haven’t quite discovered.

As an example, I recently developed a store listing directory for the Macon Mall. This is one section of code:

<ul>
   <li>Belk<br /><span class="both">Upper &amp; Lower Level</span><br />(478) 477-2355</li>
   <li>JCPenney<br /><span class="both">Upper &amp; Lower Level</span><br />(478) 477-8400</li>
   <li>Macy's<br /><span class="both">Upper &amp; Lower Level</span><br />(478) 471-3847</li>
   <li>Sears<br /><span class="both">Upper &amp; Lower Level</span><br />(478) 471-5555</li>
</ul>

How could I simplify the process of inputting this by utilizing the power of PHP?

I hope I’ve made myself clear. Feel free to ask questions if not. Thanks for the help, all!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:37:56+00:00Added an answer on May 28, 2026 at 2:37 pm
    <?php
    $stores = array(
        array(
            'name' => 'Belk',
            'level' => 'Upper & Lower Level',
            'number' => '(478) 477-2355'
        ),
        array(
            'name' => 'JCPenney',
            'level' => 'Upper & Lower Level',
            'number' => '(478) 477-8400'
        ),
        array(
            'name' => 'Macy\'s',
            'level' => 'Upper & Lower Level',
            'number' => '(478) 471-3847'
        ),
        array(
            'name' => 'Sears',
            'level' => 'Upper & Lower Level',
            'number' => '(478) 471-5555'
        )
    );
    ?>
    
    <ul>
        <?php foreach( $stores as $store): ?>
            <li><?= $store['name']?><br /><span class="both"><?= htmlspecialchars( $store['level']) ?></span><br /><?= $store['number']?></li>
        <?php endforeach; ?>
    </ul>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I find myself frequently writing code like this in the HTML HEAD and other
I frequently find myself writing code like this: List<int> list = new List<int> {
I find myself writing code that looks like this a lot: set<int> affected_items; while
I frequently find myself writing utility classes that can be re-used throughout my projects.
I find myself writing SQL code (queries or stored procs) to solve problems that
I frequently find myself working with Lists, Seqs, and Iterators of Tuples and would
I have this website, where I frequently find myself trying to pass information from
I find myself frequently writing code like this: k = 0 for i in
I frequently find myself doing this: !(val).nil? My code would be prettier if there
I frequently find myself writing code like this: tupla = (1, 2, 3, 4)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.