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 8693531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:33:52+00:00 2026-06-13T00:33:52+00:00

Basically I am trying to multiply values together. I have a ul below that

  • 0

Basically I am trying to multiply values together.

I have a ul below that is echo’ing out a numeric value,:

<ul class="TCE">
<li><span>Average drink cost</span>&nbsp;&nbsp;<?php echo the_field('average_drink_price'); ?></li>
<li><span>Average drinks spenditure per night</span>&nbsp;&nbsp;<?php echo the_field('average_drinks_spenditure_per_night'); ?></li>
<li><span>Average drinks spenditure for the year</span>&nbsp;&nbsp;<!-- JAVA BIT --></li>
<li><span>Average drinks spenditure for 3 years</span>&nbsp;&nbsp; <!-- JAVA BIT --></li>
</ul>

I want the third li to get the value of the second li and then multiply that value by exactly 28.

I then want the fourth li to get the value of the third li and multiply that by 3.

So it goes a little like this:

li-2 x 28 = li-3
li-3 x 3 = li-4

If that makes sense? The value’s for li1 and li2 will be generated via that PHP field, any help on this as I have no idea where to start?

Updated PHP testing:

<?php
var_dump(the_field('average_drinks_spenditure_per_night')); 
$li2 = the_field('average_drinks_spenditure_per_night');
$li3 = ($li2 * 28) * 2.1;
$li4 = $li3 * 3;
?>

<ul class="TCE">
<li><span>Average drink cost</span>&nbsp;&nbsp;<?php echo the_field('average_drink_price'); ?></li>
<li><span>Average drinks spenditure per night</span>&nbsp;&nbsp;<?php echo $li2; ?></li>
<li><span>Average drinks spenditure for the year</span>&nbsp;&nbsp;<?php echo $li3;?><!-- JAVA BIT --></li>
<li><span>Average drinks spenditure for 3 years</span>&nbsp;&nbsp; <?php echo $li4;?><!-- JAVA BIT --></li>
</ul>
  • 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-06-13T00:33:54+00:00Added an answer on June 13, 2026 at 12:33 am

    TRY

    <?php 
    $li2 = 1;
    if(is_numeric(trim(the_field('average_drinks_spenditure_per_night'))))
     $li2 = trim(the_field('average_drinks_spenditure_per_night'));
    $li3 = $li2 * 28;
    $li4 = $li3 * 3;
    
    ?>
    
    <ul class="TCE">
    <li><span>Average drink cost</span>&nbsp;&nbsp;<?php echo   the_field('average_drink_price'); ?></li>
    <li><span>Average drinks spenditure per night</span>&nbsp;&nbsp;<?php echo $li2; ?></li>
    <li><span>Average drinks spenditure for the year</span>&nbsp;&nbsp;<?php  echo $li3;?><!-- JAVA BIT --></li>
    <li><span>Average drinks spenditure for 3 years</span>&nbsp;&nbsp; <!-- JAVA BIT --></li>
    </ul>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to stub a method that returns multiple values. For example: class
I'm trying to figure out how to make this code work. Basically i have
I have some code below. This code is a basic push/pop stack class that
I'm basically trying to iterate through a dict and print out the key /
Basically I have a set of checkboxes that are dynamically created from view data
I am trying to select multiple values in a single column. Basically I want
Basically I have been trying to forge an understanding of matrix maths over the
I'm building, basically, an ad server. This is a personal project that I'm trying
I'm stuck trying to work out the best possible way to approach this. Basically,
I have some calculated values in the core data database that I need to

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.