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

  • Home
  • SEARCH
  • 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 687961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:10:51+00:00 2026-05-14T02:10:51+00:00

UPDATE: I know I can use <ol> directky in the output but I remember

  • 0

UPDATE:

I know I can use <ol> directky in the output but I remember using something like:

<?php echo $i++; ?> when I worked on a wordpress blog once. Every time I inserted that tag a number greater than the previous appeared so I basically did:

<?php echo $i++; ?> Text
<?php echo $i++; ?> Text
<?php echo $i++; ?> Text

I’m a front end guy (HTML/CSS) so please excuse this basic question. I just need to know what code in PHP I can use to number some text.

Text

Text

Text

into:

  1. Text

  2. Text

  3. Text

Kind of like what <ol> does in html but in PHP.

  • 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-14T02:10:51+00:00Added an answer on May 14, 2026 at 2:10 am

    Updated answer:

    You can use a variable as you already do (the example you are posting should already work). Just initialize it using $i = 0;

    Old answer:


    You have a fundamental misunderstanding here. PHP is a scripting language, not a markup language. PHP does operations like connecting to data sources, calculating, making additions, changing entries in databases, and so on. PHP code, in short, is a series of commands that are executed. PHP has no design elements, tags and formatting options in itself.

    PHP can (and usually does) output HTML (Where you have <ol>) to display things.

    You can have an array of arbitrary data in PHP, coming from a file or data source:

    $array = array("First chapter", "Second chapter", "Third chapter"); 
    

    you can output this data as HTML:

    echo "<ol>";
    
    foreach ($array as $element)  // Go through each array element and output an <li>
     echo "<li>$element</li>";
    
    echo "</ol>";
    

    the result being (roughly)

    <ol>
    <li>First chapter</li>
    <li>Second chapter</li>
    <li>Third chapter</li>
    </ol>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know I can update a single record like this - but then how
Can the #save method be used to update a record? I know that I
Do you know any documentation about the rules of using update sites? I have
UPDATE 10/19/2010 I know I asked this question a while ago, but the workarounds
update: I know there is no one best way to do everything. Sorry for
I want to know Id update panel that initial a request in JavaScript .I
Anyone know how to do an update with a join (i.e. update on two
I know the question of how to update multiple tables in SQL has been
Does anyone know how I would force the computer to update the time with
I noticed you can use the following stored procedures (in order) to schedule a

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.