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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:50:51+00:00 2026-06-13T10:50:51+00:00

I have an html table that includes 7 columns. Data is pulled from an

  • 0

I have an html table that includes 7 columns. Data is pulled from an XML feed, and should loop for the items in the feed. I assign PHP variables in the following way:

foreach ($xml->Game as $Game) { 
  $Date = $Game->Date; $AwayTeam = $Game->AwayTeam;

// Then, I assign an array to the variables under a counted for loop:

for($i=0; $i<$count; $i++){
    $arrayDate = $Date;
}

I was using PHP to echo the arrays in a Table such as: echo "<td>arrayDate[$i]</td>";

However, in 3 of the columns, I need to display Checkboxes along with my arrays.

Is there a way to display the checkbox and arrayValue in the same cell? I am flexible to PHP, JQuery and HTML options.

<?php  
require_once('db-config.php');
// rss page for Testing -  
$feed_url = "http://www.sportsbooks.com/lines/cgi/lines.cgi?tem=parse&sport=203&ct=text/xml&type=";
$xml = simplexml_load_file($feed_url);
//Connect to mysql server
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
$arrayDate = array('');
$arrayLine = array('');
$arrayLineStrip = array('');
$arrayOverPrice = array('');
$arrayUnderPrice = array('');
$arrayARotation = array('');
$arrayHRotation = array('');
$arrayAwayTeam = array('');
$arrayHomeTeam = array('');
$arrayAwayTeamPrice = array('');
$arrayHomeTeamPrice = array('');
$arrayAwayTeamMoneyLine = array('');
$arrayHomeTeamMoneyLine = array('');
$Date = (string)$xml->Date;
$AwayTeam = (string)$xml->AwayTeam;
$HomeTeam = (string)$xml->HomeTeam;
$AwayRotation = (string)$xml->AwayRotation;
$HomeRotation = (string)$xml->HomeRotation;
$Total = (string)$xml->Total;
$OverPrice = (string)$xml->OverPrice;
$UnderPrice = (string)$xml->UnderPrice;
$Line = (string)$xml->Line;
$AwayTeamPrice = (string)$xml->AwayTeamPrice;
$HomeTeamPrice = (string)$xml->HomeTeamPrice;
$AwayTeamMoneyLine = (double)$xml->AwayTeamMoneyLine;
$HomeTeamMoneyLine = (double)$xml->HomeTeamMoneyLine;
$Title = (string)$xml->Title;
?>
<html>
<div style="font-family:arial; font-size:.8em;"> 
<table id="nfl-main-1" cellpadding="0" cellspacing="0" border="1" bordercolor="#585858" width=100%>
<td>
<table id="nfl-main-2 border=1 cellpadding="0" cellspacing="0" width="100%">
<tr><td colspan="7"><table border=0 width=100% cellspacing=0 cellpadding=0><tr>
<td bgcolor="#585858" align="center" width=100%><h2 style="color:white; font-size: 16px"><?php echo $Title; ?></td>
</tr></table></td></tr>
<tr>
<div style="font-family:arial; font-size:.8em; color:white;"> 
<th>Date</th>
<th>    </th>
<th>#</th>
<th>Team</th>
<th>Money</th>
<th>Spread</th>
<th>Total</th>
</tr>       
</div>
</table>
</div>
</table>
</html>
<?php>
// # items to display 
$count = 20; 
// Characters from each item 
$char = 200; 
echo '<table cellpadding="0" align="left" cellspacing="0" border="1" bordercolor="#585858" width=100%>';
foreach ($xml->Game as $Game) { 
$Date = $Game->Date; $AwayTeam = $Game->AwayTeam; $HomeTeam = $Game->HomeTeam; $AwayRotation = $Game->AwayRotation;
$HomeRotation = $Game->HomeRotation; $Total = $Game->Total; $OverPrice = $Game->OverPrice;
$UnderPrice = $Game->UnderPrice; $Line = $Game->Line; $AwayTeamPrice = $Game->AwayTeamPrice;
$HomeTeamPrice = $Game->HomeTeamPrice; $AwayTeamMoneyLine = $Game->AwayTeamMoneyLine; $HomeTeamMoneyLine = $Game->HomeTeamMoneyLine;
for($i=0; $i<$count; $i++){
$AwayTeamSpread = " ";
$HomeTeamSpread = " ";
$arrayDate = $Date;
$arrayARotation = $AwayRotation;
$arrayHRotation = $HomeRotation;
$arrayAwayTeam = $AwayTeam;
$arrayHomeTeam = $HomeTeam;
$arrayTotal = $Total;
$arrayLine = $Line;
$arrayOverPrice = $OverPrice;
$arrayUnderPrice = $UnderPrice;
$arrayAwayTeamMoneyLine = $AwayTeamMoneyLine;
$arrayHomeTeamMoneyLine = $HomeTeamMoneyLine;
$arrayAwayTeamPrice = $AwayTeamPrice;
$arrayHomeTeamPrice = $HomeTeamPrice;
$arrayLine = $Line;
$LineStrip = str_replace("-", " ",$arrayLine);

if($arrayHomeTeamMoneyLine>0);
{
$AwayTeamSpread = "-";
$HomeTeamSpread = "+";
}
if($arrayAwayTeamMoneyLine>0);
{
$AwayTeamSpread = "+";
$HomeTeamSpread = "-";
}
echo '<tr>';
echo "<td>$arrayDate[$i]</td><td><table><tr><td>$arrayARotation[$i]</td></tr><tr><td>$arrayHRotation[$i]</td></tr></table></td><td><table><tr><td>$arrayAwayTeam[$i]</td></tr><tr><td>$arrayHomeTeam[$i]</td></tr></table></td><td><table><tr><td>$arrayAwayTeamMoneyLine[$i]</td></tr><tr><td>$arrayHomeTeamMoneyLine[$i]</td></tr></table></td><td><table><tr><td>$AwayTeamSpread $LineStrip ($arrayAwayTeamPrice)</td></tr><tr><td>$HomeTeamSpread $LineStrip ($arrayHomeTeamPrice)</td></tr></table></td><td><table><tr><td>Over $arrayTotal</td></tr><tr><td>Under $arrayTotal</td></tr></table></td>";
echo '</tr>';
echo '</table>';
echo '<table cellpadding="0" align="left" cellspacing="0" border="1" bordercolor="#585858" width=100%>';
echo '<tr>';
echo "<td>$arrayDate[$i]</td><td><table><tr><td>$arrayARotation[$i]</td></tr><tr><td>$arrayHRotation[$i]</td></tr></table></td><td><table><tr><td>$arrayAwayTeam[$i]</td></tr><tr><td>$arrayHomeTeam[$i]</td></tr></table></td>";
echo '<tr>';
}
}
?>
<form>
<td><input type="checkbox" name="AwaySpread[]" value="<?php echo '$arrayDate' ?>"><?php echo $count ?><br></td>
<input type="checkbox" name="HomeSpread[]" value="HomeSpread"><br>  
<input type="checkbox" name="Over[]" value="Over"><br> 
<input type="checkbox" name="Under[]" value="Under"><br> 
<input type="checkbox" name="AwayMoneyLine[]" value="AwayMoneyLine"><br> 
<input type="checkbox" name="HomeMoneyLine[]" value="HomeMoneyLine"><br>
<input type="submit" name="Continue" value="Continue"><br>
</form>
</html>
  • 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-13T10:50:52+00:00Added an answer on June 13, 2026 at 10:50 am

    Why don’t you use something like this,

    echo "<td><input type='checkbox'/> arrayDate[$i] </td>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an html table containing values that are being generated from javascript. How
I have a big problem. I want to extract text from html table that
Basically I have a table that is being used to display data from an
I have developed an XSL file that transforms xml files into a html table.
I have an HTML table that contains some 500 rows. I have an input
I have an HTML table that I'd like to be able to export to
I have an html table that looks like this in a standard HTML 4.01
I'm trying to have a simple html table, that highlights a row as a
I have an MVC application view that is generating quite a large HTML table
I have a PHP/MySQL query that returns to an HTML table, and I'm stuck

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.