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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:45:46+00:00 2026-06-16T05:45:46+00:00

Index.php is built from data of domains.php . How can I create these tables

  • 0

Index.php is built from data of domains.php. How can I create these tables and options in domains.php dynamically with foreach function?

domains.php

<?php

$price=array(

  "cz"=>    "20",
  "com"=>   "10",
  "net"=>   "8",
  "org"=>   "8",
  "info"=>  "8",
  "biz"=>   "8",
  "name"=>  "25",
  "mobi"=>  "25"

);

$renamed=array(

  "cz"=>    "Czech Republic",
  "com"=>   "international",
  "mobi"=>  "mobile"

);

?>

index.php

<?php include("domains.php"); ?>      

<div id="prices">
  <table class="table">
    <tr><td>.cz</td><td>20$</td></tr> 
    <tr><td>.com</td><td>10$</td></tr> 
    <tr><td>.net</td><td>8$</td></tr> 
  </table>
  <table class="table">
    <tr><td>.info</td><td>8$</td></tr> 
    <tr><td>.biz</td><td>8$</td></tr> 
    <tr><td>.name</td><td>25$</td></tr> 
  </table>
  <table class="table">
    <tr><td>.mobi</td><td>25$</td></tr> 
    <tr><td></td><td></td></tr> 
    <tr><td></td><td></td></tr> 
  </table>
</div>    

<select id="zone">
  <option value="cz">Czech Republic</option>
  <option value="com">international</option>
  <option value="net">.net</option>
  <option value="org">.org</option>
  <option value="info">.info</option>
  <option value="biz">.biz</option>
  <option value="name">.name</option>
  <option value="mobi">mobile</option>
</select>
  • 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-16T05:45:48+00:00Added an answer on June 16, 2026 at 5:45 am

    This should give you a start. For further info, there’s a lot of documentation at php.net. When you want just three rows per table, you must use some row counter.

    $row = 0;
    foreach($price as $tld => $money) {
        if ($row == 0)
            echo "<table>\n";
    
        echo "<tr><td>$tld</td><td>$money</td></tr>\n";
    
        // close the table after three rows
        $row++;
        if ($row >= 3) {
            echo "</table>\n";
            $row = 0;
        }
    }
    
    // close the final table, if needed
    if ($row > 0)
        echo "</table>\n";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've built a search index using the PHP Zend Framework Search (based on Lucene).
index.php <?php require_once('fr.php'); header('Location:'.abspath().directory()); ?> fr.php <?php require_once('functions.php'); ?> functions.php function abspath() { return
I have a jQuery function that gets data from a form and puts it
I've built my site with php include and the index is as follows: Menu.php
If I try to encode the url http://herthabsc.de/index.php?id=3631&tx_ttnews[tt_news]=13144&cHash=9ef2e9ee006fb16188ebf764232a0ba9 with urlencode() or http_build_query() it gives
index.php: <form action=update_db.php method=post> <?php require_once 'modules/' . $currentModule . '.php'; ?> </form> modules/
I have a index.php page that is the main page. All pages are included
I have an index.php for registration, a login.php as the registration handler. when the
when passing parameters after index.php its showing 404 error .. its apache error not
I have a page index.php that uses a modal to upload files. After those

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.