It's an escaped backslash, but I'd think that should only apply when escaping applies to the second backslash in the first place.
It's an escaped backslash, but I'd think that should only apply when escaping applies to the second backslash in the first place.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
I was wondering if you might expound on using the foreach loops to create a table.Also, though it doesn't apply so easily in this case, you should look into foreach() loops.
foreach($array as $item) {
echo $item;
}
foreach($array as $key => $item) {
echo $key.': '.$item;
}
I would like to use:
I want to be able to dynamically change the number of rows and columns, but have the foreach loop through each item once.... I've tried several suggestions in this post, but am still having trouble with this.PHP Code:foreach ($search->body->Items->Item as $object) {
echo '<td>';
echo '<a href="' . $object->DetailPageURL . '"><img src="' . $object->MediumImage->URL . '" /></a><br />';
echo '<a href="' . $object->DetailPageURL . '">' . $object->ItemAttributes->Title . '</a>';
echo '</td>';
}
Thanks in advance for your expert help.
Please don't necromance (bring dead threads back to life). If you really need to draw attention to an old thread, link to it.
As for your question, you'll have to use the$key => $valuesyntax because without an iterator (the key) you can't tell which row you should be on. Having that, you can figure whether you need to start a new row with$key % $columns == 0(which determines whether $key is a multiple of $columns).
I have this code that I am confused about, I can get the outpoot into an array but I cannot organize it into a table, please help
<META HTTP-EQUIV="REFRESH" CONTENT="20">
<?php
$xmlUrl = "https://secure.ifbyphone.com/ibp_api.php?api_key=6a9212f2af5a0ee41df847fd59eb63acf219404c&action=report.call_detail&start_date=20110517&end_date=20201231&format=csv&date_added=1&phone_label =1&dnis=1&ani=1&call_duration=1&transfer_to_number=1&call_type_filter=All"; // XML feed file/URL
$xmlStr = file_get_contents($xmlUrl);
$filearray = explode("\n", $xmlStr);
while (list($var, $val) = each($filearray)) {
++$var;
$val = trim($val);
print "Line $var: $val<br />";
$input =
$cols = 5;
echo "<table border=\"5\" cellpadding=\"10\">";
for ($i=0; $i < count($input); $i++)
{
echo "<tr>";
for ($c=0; $c<$cols; $c++)
{
echo "<td>$input[$i]</td>";
}
echo "</tr>";
}
echo "</table>";
}
Bookmarks