Instead of array() use range(0, 100).
O yea and count() wont work use a foreach() loop.
so, what is fully code ? š
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Tymax said instead of array:
$sira = array ('0-99');
Use range(0, 100):
$sira = range(0, 100);
ups , i used range but this time it happened like this ;
101
101
101
.
.
.
Thanks Andrew im on my ph š
And the foreach loop would just be…
foreach($sira as $number) {
echo $number
}
thank you sooo much your answers but this time happened ;
http://imgim.com/4058incid2123278.jpg
is it true ?
<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;">
<?php
$sira = array (0,100);
foreach($sira as $number) {
echo $number ;
}
?>
</td>
Sorry im not on my comp, but that should echo out =>
0
1
2
3
…100
Change array to range()
Try this,
Put this before your table:
$sira = 0;
Then in your table cell use:
<td style="text-align:left; vertical-align:middle; border: 1px solid #eee;">
<?php echo ++$sira; ?>
</td>
thx for your answers but ,
i used range and like this;
http://imgim.com/292inciw7895190.jpg
and i try Put this before your table:
http://imgim.com/6770incif1659500.jpg
It would help to see more of the code, I can’t really tell how you are building the table.
actually it should count line in table
Be good to see all the code then we could fig out what you are actually doing š
The range seems to be working. The problem is you’re not echoing any space or line breaks between the numbers.
Instead of 1 2 3 4 5 6, you’re echoing out 123456.
So if you’re doing the range, do this too:
foreach($sira as $number) {
echo $number . ‘
‘;
}
or do
foreach($sira as $number) {
echo $number . ‘ ‘;
}
thanks you for your answers š but doesnt work
http://imgim.com/4355inciu8385024.jpg
0
100
0
100
0
100
.
.
.
.
@ibrahmduman
Can you show more of the code? It’s difficult to help you if we can’t see how you build the table.
I think @csloisel last code snippet should do the trick. But without seeing the full table code it’s difficult to know for sure.